Code example for BasicHttpContext

Methods: setAttribute

		// 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 
		// TODO: need to release this connection in httpRequest() 
		// cm.releaseConnection(conn, validDuration, timeUnit); 
		// httpclient.getConnectionManager().shutdown(); 
	 * HttpRequestInterceptor for DefaultHttpClient 
Experience pair programming with AI  Get Codota for Java