Code example for BasicHttpParams

Methods: setBooleanParameter

0
 */ 
public class HttpProvider { 
	private DefaultHttpClient client;
 
	private HttpProvider(int conTimeout, int soTimeout) {
		HttpParams httpParams = new BasicHttpParams();
 
		HttpConnectionParams.setConnectionTimeout(httpParams, conTimeout);
		HttpConnectionParams.setSoTimeout(httpParams, soTimeout);
		httpParams.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, false);
 
		client = new DefaultHttpClient(httpParams);
 
	} 
 
	/** 
	 * 创建建使用默认超时时间的实例  
	 * @return 
	 */ 
	public static HttpProvider newInstance() { 
		return new HttpProvider(HttpUtils.COMMON_CONNECT_TIMEOUT, HttpUtils.COMMON_SO_TIMEOUT);