Using getResponseBodyAsStream instead is recommended解决方法
来源:互联网 发布:软件测试总结 编辑:程序博客网 时间:2024/06/17 23:56
使用 System.out.println("ResponseBody:\n"
+ method.getResponseBodyAsString());获取信息想时候有事会有如下警告:
2010-5-15 13:05:36 org.apache.commons.httpclient.HttpMethodBase getResponseBody
警告: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
成功生成(总时间:41 秒)
改成通过流读取,然后转成String就行了。
//System.out.println("ResponseBody:\n"
// + method.getResponseBodyAsString());
InputStream inputStream = method.getResponseBodyAsStream();
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
StringBuffer stringBuffer = new StringBuffer();
String str= "";
while((str = br.readLine()) != null){
stringBuffer .append(str );
}
System.out.println("ResponseBody:\n" + stringBuffer.toString());
- Using getResponseBodyAsStream instead is recommended解决方法
- Using getResponseBodyAsStream instead is recommended解决方法
- [HttpClient]Using getResponseBodyAsStream instead is recommended警告的解决方案
- Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is rec
- Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is rec
- Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is rec
- Field injection is not recommended
- Using SingleTagSectionHandler Instead Of appSettings
- the following books is recommended csep
- idea警告:Field injection is not recommended
- 使用playbooks来ping主机时显示"Using a SSH password instead of a key is not possible
- HttpClient警告“Going to buffer response body of large or unknown size. Using getResponseBodyAsStream i
- Why Using Sockets instead of Remoting
- Using dmsetup directly instead of cryptsetup
- Practice of using spinlock instead of mutex
- Linear Kernel: Why is it recommended for text classification ?
- Warning: require_gem is obsolete. Use gem instead.
- android:password is deprecated: Use inputType instead
- .net发送post请求的两种方法
- FLAG_ACTIVITY_CLEAR_TOP退出整个程序
- php中将多个数组组合成笛卡尔积!
- HttpMessageConverter
- Mining Massive Data: Minhash & Locality Sensitive Hash
- Using getResponseBodyAsStream instead is recommended解决方法
- GIS比较好的学习网站和体验中心
- linux C语言 文件描述符 读写地址分析
- JPG转换成PDF转换器使用说明
- 新的App 12个小时就进入In Review 最近苹果审核给力啊
- 1-7-3 - 简单分支问题体验
- SpringMVC restful 异常Could not write request: no suitable HttpMessageConverter found for request type
- 梯度下降法(一)入门
- linux下如何安装rzsz