Hello,

 

I’m porting my app from httpclient4.1 to httpclient4.3 and I have several
doubts:

 

1.       Where can I set the manager connection timeout?

HttpClientParams.setConnectionManagerTimeout(this.objHttpParams, 1);

 

2.       Where can I set the default connection timeout?

HttpConnectionParams.setConnectionTimeout(this.objHttpParams,
connectionTimeout);

 

3.       I see how to add a proxy to the HttpClientBuilder, but how can I
remove it?

public void setProxy(String proxyHost, int proxyPort)

{

  if (proxyPort == 0)
this.objHttpParams.removeParameter(ConnRoutePNames.DEFAULT_PROXY);

  else this.objHttp.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
new HttpHost(proxyHost, proxyPort));

}

 

4.       Similar, for example, a retry handler:

public void setRetryHandler(int retryHttp)

{

  if (retryHttp > 0) this.objHttp.setHttpRequestRetryHandler(new
DefaultHttpRequestRetryHandler(retryHttp, false));

  else this.objHttp.setHttpRequestRetryHandler(new
DefaultHttpRequestRetryHandler(0, false));

}

 

 

Thanks,

 

Joan.

 

 

Reply via email to