Code example for ClientProtocolException

0
 
	public void process(HttpResponse response, HttpContext context)
	  throws HttpException, IOException { 
	AuthenticationHandler handler = client.getTargetAuthenticationHandler();
	if (stop_auth && handler.isAuthenticationRequested(response, context)) {
	  throw new ClientProtocolException("Authentication failed");
	} 
	} 
 
	public HttpResponse execute(HttpUriRequest request)
	  throws IOException, ClientProtocolException { 
	stop_auth = false;
	try { 
	  return client.execute(request);
	} catch (RuntimeException ex) {
	  throw new ClientProtocolException(ex.getMessage());
	} 
	} 
 
	public HttpResponse execute(HttpUriRequest request, HttpContext context)
	  throws IOException, ClientProtocolException {