@PostMapping("/test")
public void test(HttpServletRequest httpServletRequest) {
int length = httpServletRequest.getContentLength();
byte[] buffer = new byte[length];
ServletInputStream in = null;
try {
in = httpServletRequest.getInputStream();
in.read(buffer, 0, length);
in.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (null != in) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
try {
log.info(new String(buffer, "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}