1. if(response.getEntity() != null && response.getEntity().getContent() != null)
  2. {
  3. message = IOUtils.toString(response.getEntity().getContent());
  4. }
会报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.

看一下:http://blog.csdn.net/boonya/article/details/42740235

最新文章

  1. python 学习(二)--关于类
  2. svn: Can't convert string from 'UTF-8' to native encoding 的解决办法(转)
  3. PHP面向对象实例(图形计算器)
  4. Activity启动模式
  5. Spring3系列13-Controller和@RequestMapping
  6. Maven项目的目录结构+maven的安装与配置
  7. [转]Hibernate3如何解决n+1 selects
  8. Genymotion中文手册
  9. 你真的会用 SDWebImage?
  10. Centos5搭建vsftpd服务
  11. 【NPOI】通过NPOI从内存流中创建EXCEL
  12. Serializable 和Parcelable 的区别
  13. Linux 安装 yum
  14. Log4j Append属性指定是否追加内容
  15. python第二十七课——os模块
  16. Scala进阶之路-为什么要学习Scala以及开发环境搭建
  17. [转]mysql性能优化-慢查询分析、优化索引和配置
  18. Jmeter关于上传图片接口
  19. sublime text 3 常见问题总结 pyv8
  20. 首屏渲染时间获取 performance.now()

热门文章

  1. [经验交流] 为 mesos framework 分配资源
  2. 动态linq to list排序
  3. 用Maven新建Web项目时报错
  4. 新安装loadrunner无法录制脚本的原因之一及解决方案
  5. centos6.3(64位) 安装apr
  6. 使用Visual Studio调试用户模式进程(Debugging a User-Mode Process Using Visual Studio)
  7. 解决 umount 时出现的 "Device is busy"
  8. 在Excel中将数字转换为大写
  9. ImageJ 学习第一篇
  10. 2.2 ARM处理器工作模式