Content has been consumed
2024-08-29 11:09:10
- if(response.getEntity() != null && response.getEntity().getContent() != null)
- {
- message = IOUtils.toString(response.getEntity().getContent());
- }
会报Content has been consumed错误
这个问题是多次调用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.
最新文章
- python 学习(二)--关于类
- svn: Can't convert string from 'UTF-8' to native encoding 的解决办法(转)
- PHP面向对象实例(图形计算器)
- Activity启动模式
- Spring3系列13-Controller和@RequestMapping
- Maven项目的目录结构+maven的安装与配置
- [转]Hibernate3如何解决n+1 selects
- Genymotion中文手册
- 你真的会用 SDWebImage?
- Centos5搭建vsftpd服务
- 【NPOI】通过NPOI从内存流中创建EXCEL
- Serializable 和Parcelable 的区别
- Linux 安装 yum
- Log4j Append属性指定是否追加内容
- python第二十七课——os模块
- Scala进阶之路-为什么要学习Scala以及开发环境搭建
- [转]mysql性能优化-慢查询分析、优化索引和配置
- Jmeter关于上传图片接口
- sublime text 3 常见问题总结 pyv8
- 首屏渲染时间获取 performance.now()
热门文章
- [经验交流] 为 mesos framework 分配资源
- 动态linq to list排序
- 用Maven新建Web项目时报错
- 新安装loadrunner无法录制脚本的原因之一及解决方案
- centos6.3(64位) 安装apr
- 使用Visual Studio调试用户模式进程(Debugging a User-Mode Process Using Visual Studio)
- 解决 umount 时出现的 ";Device is busy";
- 在Excel中将数字转换为大写
- ImageJ 学习第一篇
- 2.2 ARM处理器工作模式