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);
	 * HttpRequestInterceptor for DefaultHttpClient 默认HTTP客户端的请求拦截器 
	private HttpRequestInterceptor preemptiveAuth = new HttpRequestInterceptor() {
		public void process(final HttpRequest request, final HttpContext context) { 
			AuthState authState = (AuthState) context 
Experience pair programming with AI  Get Codota for Java