You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Jacob Williams <ja...@gmail.com> on 2011/09/01 00:42:59 UTC

HttpMethod - releasing connections by closing body stream

In HttpClient 3 HttpMethod provides a releaseConnection method. An OAuth
library I'm working with (http://oauth.googlecode.com/svn/code/java/) uses
HttpMethod but doesn't provide a way of invoking releaseConnection. As a
workaround I'm using getResponseBodyAsStream().close() (even though I don't
need the response body). This seems to work but I'm not sure why - anyone
know if that's a normal/reliable way of releasing the connection?

Thanks,
Jacob Williams

Re: HttpMethod - releasing connections by closing body stream

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2011-08-31 at 17:42 -0500, Jacob Williams wrote:
> In HttpClient 3 HttpMethod provides a releaseConnection method. An OAuth
> library I'm working with (http://oauth.googlecode.com/svn/code/java/) uses
> HttpMethod but doesn't provide a way of invoking releaseConnection. As a
> workaround I'm using getResponseBodyAsStream().close() (even though I don't
> need the response body). This seems to work but I'm not sure why - anyone
> know if that's a normal/reliable way of releasing the connection?
> 

No, it is not. It is neither normal nor reliable.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org