hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaikit Savla <jaikit.sa...@yahoo.com.INVALID>
Subject Re: Custom httpclient configuration
Date Sun, 21 Sep 2014 20:29:03 GMT
RequestConfig represents request level parameters. Socket and connect
timeout values, if non-zero, override those used by default.


Thread below was specific to HttpAsync client but for Sync client also it should stand true.

http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/201310.mbox/%3C1382089744.18812.32.camel@ubuntu%3E

Thanks,
Jaikit


On Sunday, September 21, 2014 4:05 AM, "Shih-liang, Chang" <atkinschang@icloud.com>
wrote:



Hi

I'm using the HttpClient 4.4. 
I am creating HttpClient instance using custom settings. Is the following configuration the
same effect? or whats the different between them? I can’t find it in javadoc.
A.
SocketConfig socketConfig = SocketConfig.custom()
    .setSoTimeout(DEFAULT_SOCKET_TIMEOUT)
    .build();
CloseableHttpClient httpClient = HttpClients.custom()
     .setDefaultSocketConfig(socketConfig)
     .build();


B.


RequestConfig requestConfig = RequestConfig.custom()
    .setSocketTimeout(DEFAULT_SOCKET_TIMEOUT)
    .build();
CloseableHttpClient httpClient = HttpClients.custom()
     .setDefaultRequestConfig(requestConfig)
     .build();


Thanks in advance.
BR,
Atkins

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


Mime
View raw message