HttpServletRequest得到请求内容

HttpServletRequest得到请求内容的方法是:

  |--request.getInputStream();

InputStream in = request.getInputStream();

byte[] buf = new byte[1024];

int len = 0;

while((len = in.read(buf)!=-1){

  String str = new String(buf, 0, len);

}

//char c =(char)in.read();// in.read()返回的是整型的Asscll码

 

posted @ 2016-01-04 01:21  心灵召唤  阅读(363)  评论(0)    收藏  举报