title: How do I replace Deprecated httpClient.getParams() with RequestConfig?
body: <p>I have inherited the code </p>
  
  <pre><code>import org.apache.http.client.HttpClient;
  ...
  HttpClient httpclient = createHttpClientOrProxy();
  ...
  
  
  
  private HttpClient createHttpClientOrProxy() {
      HttpClient httpclient = new DefaultHttpClient();
  
      /*
       * Set an HTTP proxy if it is specified in system properties.
       * 
       * http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
       * http://hc.apache.org/httpcomponents-client-ga/httpclient/examples/org/apache/http/examples/client/ClientExecuteProxy.java
       */
      if( isSet(System.getProperty("http.proxyHost")) ) {
          int port = 80;
          if( isSet(System.getProperty("http.proxyPort")) ) {
              port = Integer.parseInt(System.getProperty("http.proxyPort"));
          }
          HttpHost proxy = new HttpHost(System.getProperty("http.proxyHost"), port, "http");
  // @Deprecated methods here... getParams() and ConnRoutePNames
          httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
      }
      return httpclient;
  }
  </code></pre>
  
  <p><code>httpClient.getParams()</code> is @Deprecated and reads "</p>
  
  <pre><code>HttpParams  getParams()
  Deprecated. 
  (4.3) use RequestConfig.
  </code></pre>
  
  <p>There are no class docs for RequestConfig and I do not know what method should be used to replace <code>getParams()</code> and <code>ConnRoutePNames.DEFAULT_PROXY</code>.</p>