Dear Wiki user, You have subscribed to a wiki page or wiki category on "Httpcomponents Wiki" for change notification.
The following page has been changed by OlegKalnichevski: http://wiki.apache.org/HttpComponents/HttpClientTutorial ------------------------------------------------------------------------------ === Ensuring release of low level resources === - When finished with a response entity, it's important to ensure that all entity content has been fully consumed. The easiers way to do so is to call the HttpEntity#consumeContent() method to consume any available content on the stream, so the connection could be safely released to the connection pool and re-used by the connection manager for subsequent requests. + When finished with a response entity, it's important to ensure that all entity content has been fully consumed, so that the connection could be safely returned to the connection pool and re-used by the connection manager for subsequent requests. The easiest way to do so is to call the HttpEntity#consumeContent() method to consume any available content on the stream. HttpClient will automatically release the underlying connection back to the connection manager as soon as it detects that the end of the content stream has been reached. The HttpEntity#consumeContent() method is safe to call more than once. There can be situations, however, when only a small portion of the entire response content needs to be retrieved and the performance penalty for consuming the remaining content and making the connection reusable is too high, one can simply terminate the request by calling HttpUriRequest#abort() method. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
