getContent()抛出MalformedChunkCodingException

时间:2019-06-23 15:32:31

标签: android apache httpclient

response.getEntity().getContent()引发异常:

org.apache.http.MalformedChunkCodingException: Chunked stream ended unexpectedly

在Android 5.1上使用Apache HttpClient时。但是我的其他Java WebService效果很好。


HttpEntity bufferEntity = null;
            HttpResponse response = client.execute(uriRequest, httpContext);


            response.getEntity();//This test line would throw an exception 
            HttpEntity entity = response.getEntity();
            if (entity != null) {
                bufferEntity = new BufferedHttpEntity(entity);
                responseBody = EntityUtils.toString(bufferEntity, ENCODE_UTF8);
                NLog.e(tag, "responseBody : " + responseBody);

            }

0 个答案:

没有答案