Code example for BasicHttpParams

0
	 * @param charset 
	 *            �������뼯, �ɿ� 
	 * @return DefaultHttpClient ���� 
	 */ 
	private static DefaultHttpClient getDefaultHttpClient(final String charset) {
		HttpParams httpParams = new BasicHttpParams();
 
		// �������ӳ�ʱ�� Socket ��ʱ���Լ� Socket ������С 
		HttpConnectionParams.setConnectionTimeout(httpParams, 20 * 1000);
		HttpConnectionParams.setSoTimeout(httpParams, 20 * 1000);
		HttpConnectionParams.setSocketBufferSize(httpParams, 8192);
 
		// �����ض�����ȱʡΪ true 
		HttpClientParams.setRedirecting(httpParams, true);
 
		// ���� user agent 
		String userAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2) Gecko/20100115 Firefox/3.6";
		HttpProtocolParams.setUserAgent(httpParams, userAgent);
 
		return new DefaultHttpClient(httpParams);