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 ...
随机推荐
- <<Differential Geometry of Curves and Surfaces>>笔记
<Differential Geometry of Curves and Surfaces> by Manfredo P. do Carmo real line Rinterval I== ...
- Html5上传后有所见图片效果前端代码实现
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 实践最简单的项目:WC
wc.exe是一个常见的工具,它能统计文本文件的字符数.单词数和行数.这个项目要求写一个命令行程序,模仿已有的wc.exe的功能,并加以扩充,给出某程序设计源语言文件的字符数.单词数和行数. 给实现一 ...
- RHEL7 修改SSH默认端口及修改SELinux运行状态
RHEL7安装后,默认开启SSH服务以便远程配置,但默认端口22并不安全,一般不建议使用默认端口,那就修改SSH默认端口.在sshd_config里面的修改RHEL7.0上修改和7.0以下类似,但要注 ...
- linux备份mysq脚本
filename=`date +%Y%m%d_%H%M%S`database=finebwservername=officialcreatefilename=${servername}_${datab ...
- [REP]AWS Regions and Availability Zones: the simplest explanation you will ever find around
When it comes to Amazon Web Services, there are two concepts that are extremely important and spanni ...
- 查看MS SQL SERVER 错误日志
查看目的: 错误日志的查看是确保过程已成功完成(例如,备份和恢复操作,批处理命令,或其他脚本和过程).这可以帮助检测任何当前或潜在的问题,包括自动恢复信息(尤其是如果SQL Server实例已停止并重 ...
- 在VS中添加lib的简单方法
1.工程---属性---配置属性---VC++ Directories---General---Include Directories:加上头文件存放目录 2.VC中,切换到"解决方案视图& ...
- Github-素材篇
my github: http://github.com/yaochao
- OpenGL学习笔记0——安装库
最近需要做一个基于Zigbee室内无线定位的系统,受到TI公司ZigBee Sensor Monitor软件的启发,打算用OpenGL来做一个3D显示空间内物体位置的程序.学习阶段选择VS2010+O ...