1、
BufferedReader reader = request.getReader();
char[] buf = new char[1024];
int len = 0;
StringBuffer sb = new StringBuffer();
while ((len = reader.read(buf)) != -1) {
sb.append(buf, 0, len);
}
String result = sb.toString();
2、
InputStream is = request.getInputStream();
InputStreamReader reader = new InputStreamReader(is, "gbk");
StringWriter writer = new StringWriter();
char[] buffer = new char[1024];
int n = 0;
while (-1 != (n = reader.read(buffer))) {
writer.write(buffer, 0, n);
}
String result = writer.toString();