public List<Challenge> challenges(){
  String responseField;
  if (code == HTTP_UNAUTHORIZED) {
    responseField="WWW-Authenticate";
  }
 else   if (code == HTTP_PROXY_AUTH) {
    responseField="Proxy-Authenticate";
  }
 else {
    return Collections.emptyList();
  }
  return OkHeaders.parseChallenges(headers(),responseField);
}

public List < Challenge > challenges ( ) { String responseField ; if ( code == HTTP_UNAUTHORIZED ) { responseField = "WWW-Authenticate" ; } else if ( code == HTTP_PROXY_AUTH ) { responseField = "Proxy-Authenticate" ; } else { return Collections . emptyList ( ) ; } return OkHeaders . parseChallenges ( headers ( ) , responseField ) ; }
returns the authorization challenges appropriate for this response ' s code . if the response code is 401 unauthorized , this returns the " www - authenticate " challenges . if the response code is 407 proxy unauthorized , this returns the " proxy - authenticate " challenges . otherwise this returns an empty list of challenges .
