从request对象中获取请求json格式的参数

BufferedReader streamReader = new BufferedReader( new InputStreamReader(request.getInputStream(), "UTF-8"));
StringBuilder responseStrBuilder = new StringBuilder();
String inputStr;
while ((inputStr = streamReader.readLine()) != null){
responseStrBuilder.append(inputStr);
}
JSONObject jsonObject = JSONObject.parseObject(responseStrBuilder.toString());
posted @ 2021-03-31 19:09  山兮木  阅读(2260)  评论(0编辑  收藏  举报
/* 看板娘 */