Android xmlPullParser 异常分块流意外结束
我在使用 xmlPull 解析器解析 XMl 时遇到错误。 我得到的例外是 org.apache.http.MalformedChunkCodingException:分块流意外结束,
您能否让我知道错误的原因和处理方法。
I am getting an error wil parsing an XMl using the xmlPull parser.
The exception that i am getting is
org.apache.http.MalformedChunkCodingException: Chunked stream ended unexpectedly
Can you please let me know the reason for the error and methods to handle it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它是由旧的 apache httpclient 引起的(它无法正确处理分块的 http 请求),但我目前不知道如何在客户端解决它。
您可以使用新的 apache httpclient 版本编写自己的固件,但这是......
我看到的另一个解决方案是在客户端和服务器之间设置一个代理,该代理删除分块编码(fiddler 能够做到这一点)
(也许您可以强制服务器端未分块响应...)
Its caused by an old apache httpclient (its not able to handle chunked http requests correctly), but I currently don't know how to solve it on the client side.
You could write your own firmware with the new apache httpclient version, but this is ....
Another solution I saw is to setup a proxy between client and server which removes the chunked encoding (fiddler is able to do this)
(Perhaps you could force on the server side un-chunked responses ...)
您可以在读完 InputStream 之前关闭 AndroidHttpClient 吗?
Could you be closing your AndroidHttpClient before you are finished reading your InputStream?