On Mon, 2011-06-13 at 14:38 -0400, Srinivas wrote: > I am getting an exception while trying to get the content from a > HttpResponse. > > Code: > > String message = IOUtils.toString(response.getEntity().getContent()); > ... // Do Something with InputStream > > EntityUtils.close(response.getEntity()); > > In EntityUtils class close method; I get an IOException at line 65 > > // Line 65 > InputStream instream = entity.getContent(); > > The exception is java.io.IOException: Attempted read from closed stream. > > Further debugging; I found that when the response encoding uses gzip > ("Content-Encoding: gzip"); I get this error. So basically if its a > BasicHttpEntity instead of GzipDecompressingEntity it works fine. Otherwise > this exception is thrown. > > Appreciate any inputs into this. > > Thanks, > Srinivas
Most likely this is the result of this defect https://issues.apache.org/jira/browse/HTTPCLIENT-1075 Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org