Code example for AbstractHttpClient

Methods: getParams

0
    } 
 
    public static void setSocketTimeout(int i)
    { 
        socketTimeout = i;
        HttpConnectionParams.setSoTimeout(httpClient.getParams(), i);
    } 
 
    public static void setUserAgent(String s)
    { 
        httpUserAgent = s;
        HttpProtocolParams.setUserAgent(httpClient.getParams(), s);
    } 
 
    public static void setupHttpClient() 
    { 
        BasicHttpParams basichttpparams = new BasicHttpParams();
        ConnManagerParams.setTimeout(basichttpparams, socketTimeout);
        ConnManagerParams.setMaxConnectionsPerRoute(basichttpparams, new ConnPerRouteBean(maxConnections));
        ConnManagerParams.setMaxTotalConnections(basichttpparams, 4);
        HttpConnectionParams.setSoTimeout(basichttpparams, socketTimeout);