Code example for BasicHttpContext

Methods: setAttribute

0
		// mClient.setAuthSchemes(authRegistry); 
		mClient.setCredentialsProvider(new BasicCredentialsProvider());
 
		// Generate BASIC scheme object and stick it to the local 
		// execution context 
		localcontext = new BasicHttpContext();
		localcontext.setAttribute("preemptive-auth", basicScheme);
 
		// first request interceptor 
		mClient.addRequestInterceptor(preemptiveAuth, 0);
		// Support GZIP 
		mClient.addResponseInterceptor(gzipResponseIntercepter);
 
		// TODO: need to release this connection in httpRequest() 
		// cm.releaseConnection(conn, validDuration, timeUnit); 
		// httpclient.getConnectionManager().shutdown(); 
	} 
 
	/** 
	 * HttpRequestInterceptor for DefaultHttpClient 
	 */