@PostMapping("login")
public String login(HttpServletRequest request) {
StringBuilder data = new StringBuilder();
String line;
BufferedReader reader;
try {
reader = request.getReader();
while (null != (line = reader.readLine())) {
data.append(line);
}
} catch (IOException e) {
return null;
}
JSONObject jsonObject = new JSONObject(data.toString());
return jsonObject.toString();
}
HttpServletRequest如何转化为JSONObject
最新推荐文章于 2024-07-06 15:41:30 发布