int formDataLength = request.getContentLength();
// åå¾ServletInputStreamè¾å
¥æµå¯¹è±¡
DataInputStream dataStream = new DataInputStream(
request.getInputStream());
byte body[] = new byte[formDataLength];
int totalBytes = 0;
while (totalBytes < formDataLength) {
int bytes = dataStream.read(body, totalBytes, formDataLength);
totalBytes += bytes;
}
String json = new String(body, "ISO-8859-1");
System.out.println(json);
温馨提示:内容为网友见解,仅供参考