Code example for HttpClient

Methods: getParams

0
 
            HttpClient client = (HttpClient) instance;
 
            // ensure we default to HTTP 1.1 
            HttpParams params = client.getParams();
            params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);
 
            // AndroidHttpClient sets these two parameters thusly by default: 
            // HttpConnectionParams.setSoTimeout(params, 60 * 1000); 
            // HttpConnectionParams.setConnectionTimeout(params, 60 * 1000); 
 
            // however it doesn't set this one... 
            ConnManagerParams.setTimeout(params, 60 * 1000);
 
            return client;
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);