Code example for BasicHttpParams

0
	private PreyRestHttpClient(Context ctx) {
		this.ctx = ctx;
		//httpclient = new DefaultHttpClient(); 
		httpclient = (DefaultHttpClient) HttpUtils.getNewHttpClient();
 
		HttpParams params = new BasicHttpParams();
		 
		// Set the timeout in milliseconds until a connection is established. 
		int timeoutConnection = 30000;
		HttpConnectionParams.setConnectionTimeout(params, timeoutConnection);
		 
		// Set the default socket timeout (SO_TIMEOUT)  
		// in milliseconds which is the timeout for waiting for data. 
		int timeoutSocket = 50000;
		HttpConnectionParams.setSoTimeout(params, timeoutSocket);
		 
		HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
		HttpProtocolParams.setContentCharset(params, "UTF_8");
		HttpProtocolParams.setUseExpectContinue(params, false);
		HttpProtocolParams.setUserAgent(params, getUserAgent());