On Mon, 2016-12-12 at 17:47 -0500, Joseph Naegele wrote: > Hi all, back again. > > Now I'm wondering how to properly limit the number of bytes downloaded by the > synchronous HttpClient (v4.5, i.e. most recent versions). > > Like the HttpAsyncClient, even if I only read the desired number of bytes > from a response entity's InputStream, closing the entity results in the > remainder of the response entity being downloaded from the connection. I > found this in ContentLengthInputStream's close method, which is wrapped by > EofSensorInputStream. > > Again, my goal is to intentionally collect a truncated response if it's > larger than my limit. > > Thanks! > Joe Naegele >
Call CloseableHttpResponse#close without closing the entity. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org