Content has been consumed
- if(response.getEntity() != null && response.getEntity().getContent() != null)
- {
- message = IOUtils.toString(response.getEntity().getContent());
- }
这个问题是多次调用HttpEntity.getContent()导致的, Entity中的内容只能读取一次, 参考如下:
You can retrieve the content from the entity only once. If you have
already extracted the content somewhere, and you try to fetch it
again, it will throw this IllegalStateException. Check you code and
make sure that you make this call only once.
Content has been consumed的更多相关文章
- HTTPClient网络异常:java.lang.IllegalStateException: Content has been consumed
在对代码进行重构时候,出现了一个异常,代码的网络请求使用的是HTTPClient: 但是其实代码中没有添加什么,只是添加了两句log: 后来发现是因为将EntityUtils.toString()方法 ...
- [置顶] Android开发笔记(成长轨迹)
分类: 开发学习笔记2013-06-21 09:44 26043人阅读 评论(5) 收藏 Android开发笔记 1.控制台输出:called unimplemented OpenGL ES API ...
- HttpClient学习笔记
HttpClient相关的实体类官方文档地址:http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/ 使用HttpClien ...
- How to Preloading content with rel preload
The preload value of the <link> element's rel attribute allows you to write declarative fetch ...
- requests的content与text导致lxml的解析问题
title: requests的content与text导致lxml的解析问题 date: 2015-04-29 22:49:31 categories: 经验 tags: [Python,lxml, ...
- Content Security Policy 入门教程
阮一峰文章:Content Security Policy 入门教程
- android 使用Tabhost 发生could not create tab content because could not find view with id 错误
使用Tabhost的时候经常报:could not create tab content because could not find view with id 错误. 总结一下发生错误的原因,一般的 ...
- 【解决方案】cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of '{"http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/xml/ns/javaee":security-role-r
[JAVA错误] cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One o ...
- 注意 AppResLib.dll.*.mui 的生成操作应该为 Content
为 Windows Phone 8 App 添加本地化的时候,发现修改 AppResLib.dll.*.mui 后不仅没有其变化,还发现修改它导致它失效.通过对比代码发现,问题原因是 AppResLi ...
随机推荐
- 【转】Java代码规范
[转]Java代码规范 http://blog.csdn.net/huaishu/article/details/26725539
- day25、 静态属性、类方法、静态方法、组合、继承、
一. 静态属性.类方法.静态方法 1.1静态属性 class Room: def __init__(self,name,owner,width,length): self.name=name self ...
- Gemfile分平台加载gem
Gemfile分平台加载gem 区分平台以便加载不同的web server,象tzinfo-data只适用于windows # Windows does not include zoneinfo fi ...
- DHTMLX-Windows
DHTMLX-Windows dhtmlxWindows窗口,允许用户使用几个窗户并允许windows重叠,并提供对用户执行标准操作,比如移动/调整窗口大小,发送窗口的前景/背景,最小化/最大化一个窗 ...
- Android学习笔记(九)
Android中的四种基本布局 1.LinearLayout LinearLayout称为线性布局,是一种常用的布局.修改activity_main.xml中的代码,如下所示: <LinearL ...
- AMap公交线路查询
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http ...
- Spring Test+JUnit整合使用
在做spring相关测试时比较麻烦,如果只用JUnit测试,需要没测有初始化一下applicationContext,效率比较底下,而且也有不足之处.具体见下文 导致多次Spring容器初始化问题 根 ...
- CentOS7:Puppet推送Zabbix Agent
创建zabbix模块目录: $ mkdir -p /etc/puppet/modules/zabbix/{manifests,templates} 创建init.pp清单: $ cat /etc/pu ...
- 在Excel中将数字转换为大写
123.09 = 壹佰贰拾叁元零玖分 =SUBSTITUTE(SUBSTITUTE(IF(G10<0,"負","")&TEXT(TRUNC(ABS ...
- Linux学习笔记(二)
1.tzselect无法是使用 vim /usr/bin/tzselect 将 ${TZDIR=pwd}改为${TZDIR=/usr/share/zoneinfo} 2.sudo apt-get in ...