我有以下代码:
HttpClient FETCHER
HttpResponse response = FETCHER.execute(host, httpMethod);我试着把它的内容读成这样的字符串:
HttpEntity entity = response.getEntity();
InputStream st = entity.getContent();
StringWriter writer = new StringWriter();
IOUtils.copy(st, writer);
String content = writer.toString();问题是,当我获取http://www.google.co.in/页面时,传输编码是块的,而我只得到第一个块。它一直到第一个“。
如何同时获得所有的块,以便转储完整的输出并对其进行一些处理?
发布于 2010-05-18 22:40:35
你不应该使用writeTo吗?医生说:
将实体内容写入输出流.
https://stackoverflow.com/questions/2861486
复制相似问题