Wie ersetze ich veraltete httpClient.getParams () durch RequestConfig?

Ich habe den Code geerbt

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;
}

httpClient.getParams() ist veraltet und liest "

HttpParams  getParams()
Deprecated. 
(4.3) use RequestConfig.

Es gibt keine Klassendokumente für RequestConfig und ich weiß nicht, welche Methode zum Ersetzen verwendet werden sollgetParams() undConnRoutePNames.DEFAULT_PROXY.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage