Code example for HttpClient

Methods: getParams

0
  public void setConnectTimeout(int timeout) {
    connectTimeout_ = timeout;
    if (null != this.client) {
      // WARNING, this modifies the HttpClient params, this might have an impact elsewhere if the 
      // same HttpClient is used for something else. 
      client.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectTimeout_);
    } 
  } 
 
  public void setReadTimeout(int timeout) {
    readTimeout_ = timeout;
    if (null != this.client) {
      // WARNING, this modifies the HttpClient params, this might have an impact elsewhere if the 
      // same HttpClient is used for something else. 
      client.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, readTimeout_);
    } 
  } 
 
  public void setCustomHeaders(Map<String,String> headers) {
    customHeaders_ = headers;
  }