//this.getRequest()此处需要先获取HttpServletRequest对象拿到输入流
BufferedReader br = new BufferedReader(new InputStreamReader(this.getRequest().getInputStream(), "UTF-8"));
String line = null;
StringBuilder sb = new StringBuilder();
while ((line = br.readLine()) != null) {
sb.append(line);
}
br.close();
JSONObject jsonObject = JSONObject.fromObject(sb.toString());
Java获取post请求json格式参数(raw)
最新推荐文章于 2024-07-22 21:52:24 发布