On Mar 12, 2010, at 7:15am, <[email protected]> <[email protected]
> wrote:
On 12/03/2010 14:56, "ext Ken Krugler" <[email protected]>
wrote:
When you create the DefaultHttpClient, you can specify an HttpParams
parameter that contains configuration information, including various
timeout values.
See
http://hc.apache.org/httpcomponents-client/tutorial/html/connmgmt.html#d4e391
And also
http://hc.apache.org/httpcomponents-core/httpcore/apidocs/org/apache/http/params/HttpConnectionParams.html
A typical snippet looks like:
HttpParams params = new BasicHttpParams();
....
HttpConnectionParams.setSoTimeout(params, _socketTimeout);
HttpConnectionParams.setConnectionTimeout(params,
_connectionTimeout);
....
ThreadSafeClientConnManager cm = new
ThreadSafeClientConnManager(params, schemeRegistry);
_httpClient = new DefaultHttpClient(cm, params);
Thanks for your reply. I wonder one this though, will the default
params in DefaultHttpClient be overwritten by params or are they
added?
If you're talking about the per-request params you can add, then they
should override whatever default parameters you've specified when
creating the HttpClient instance.
The HttpClient 4.0 tutorial has some extensive information about
configuration management.
-- Ken
--------------------------------------------
Ken Krugler
+1 530-210-6378
http://bixolabs.com
e l a s t i c w e b m i n i n g
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]