Code example for HttpUriRequest

Methods: addHeadergetParams

0
	 * Setup HTTPConncetionParams 
	 * @param request 
	 */ 
	private void setupHTTPConnectionParams(HttpUriRequest request) {
		 
		HttpConnectionParams.setConnectionTimeout(request.getParams(), CONNECTION_TIMEOUT_MS);
		HttpConnectionParams.setSoTimeout(request.getParams(), SOCKET_TIMEOUT_MS);
		((DefaultHttpClient) httpClient).setHttpRequestRetryHandler(requestRetryHandler);
		//method.addHeader("Accept-Encoding", "gzip, deflate"); 
		request.addHeader("Accept-Charset", "UTF-8,*;q=0.5");
	} 
 
	/** 
	 * 解析HTTP错误码 
	 * @param statusCode 
	 * @return 
	 */ 
	public static String getCause(int statusCode) {
		String cause = null;                      
		switch (statusCode) {
Connect your IDE to all the code out there  Get Codota for Java