Code example for DefaultHttpClient

Methods: setParams

     * initialize the general property fields 
    private void initialize() 
        client = new DefaultHttpClient();
        //set http params 
        HttpParams params= new BasicHttpParams();
        HttpConnectionParams.setConnectionTimeout(params, 10000);// try 10 seconds to get a socket connection
        HttpConnectionParams.setSoTimeout(params, 20000);// wait 30 seconds waiting for data. then break connection.
     * set user credentials with manually developed preemtive Auth 
    private void setCredentials() 
        if (isSecured) {
Stop searching for code, let great code find you!  Add Codota to your java IDE