Example usage for org.apache.http.client AuthenticationHandler isAuthenticationRequested

List of usage examples for org.apache.http.client AuthenticationHandler isAuthenticationRequested

Introduction

In this page you can find the example usage for org.apache.http.client AuthenticationHandler isAuthenticationRequested.

Prototype

boolean isAuthenticationRequested(HttpResponse response, HttpContext context);

Source Link

Document

Determines if the given HTTP response response represents an authentication challenge that was sent back as a result of authentication failure

Usage

From source file:net.shirayu.android.WlanLogin.MyHttpClient.java

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");
    }//from  w  w w  . j av  a  2  s  .  c  o m
}