org.apache.http.impl.client.DefaultHttpClient 是否支持分块编码?
我不明白为什么我总是得到这个:
org.apache.http.TruncatedChunkException: Truncated chunk ( expected size: 16384; actual size: 13532)
一段Scala代码:
val method = new HttpGet(uri)
val client = new DefaultHttpClient()
val response = client.execute(method)
Option(response.getEntity).foreach(
body => {
io.Source.fromInputStream(body.getContent).
getLines().foreach(line => doStuff(line))
}
response.getEntity.getContent.close()
)