Skip to content
标签
欢迎扫码关注公众号

如何从 HttpServletRequest 获取请求内容

java
import net.sf.json.JSONObject;

HttpServletRequest request;

StringBuffer sb = new StringBuffer();
BufferedReader reader = request.getReader();
while ((line = reader.readLine()) != null) {
    sb.append(line);
}
String requestBody = sb.toString();

// 获取 JSON 请求中的某个字段值
JSONObject reagobj = JSONObject.fromObject(jb.toString());
try {
    value = reagobj.getString("token");
} catch (Exception ex) {
    Logger.error(ex.getMessage())
}

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.