Code example for DefaultHttpClient

Methods: getParams

0
 
	/** 
	 * Configures the httpClient to connect to the URL provided. 
	 */ 
	public static HttpClient getHttpClient(Integer timeout) {
		HttpClient httpClient = new DefaultHttpClient();
		final HttpParams params = httpClient.getParams();
		if (timeout == null) {
			timeout = REQUEST_TIMEOUT_MS;
		} 
		HttpConnectionParams.setConnectionTimeout(params, timeout);
		HttpConnectionParams.setSoTimeout(params, timeout);
		ConnManagerParams.setTimeout(params, timeout);
		return httpClient;
	} 
 
	public static HttpClient getHttpClient() {
		return getHttpClient(REQUEST_TIMEOUT_MS);
	} 
 
	/**