hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <http-as...@dubioso.net>
Subject Re: Concurrency question
Date Sat, 10 Jun 2006 05:26:02 GMT
Hello Sidd,

> Since the connection needs to be conversational, we need to maintain
> cookies. I noticed the class that wraps this is HttpState.
> HttpClient wraps this class.

HttpClient wraps only the default HttpState object, for those that
don't need to maintain separate states.

> So I declared HttpClient as static to reuse it for all requests to all
> remote services. And I passed it the MultiThreadedHttpConnectionManager for
> handling concurrent requests. But I cannot figure out how to set HttpState
> in a thread-safe manner.

The trick is to choose the appropriate executeRequest(...) method.
This one will use the HttpState you pass as the third argument:


hope that helps,

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

View raw message