从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());
标签:responseStrBuilder,JSONObject,StringBuilder,request,new,json,inputStr,格式,streamR 来源: https://www.cnblogs.com/xr210/p/14603295.html