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);
}