Code example for StatusLine

Methods: getReasonPhrasegetStatusCode

0
               InvalidClientException, InvalidGrantException, 
               UnauthorizedClientException, UnsupportedGrantTypeException, 
               InvalidScopeException, OAuthException { 
 
        StatusLine statusLine = this.httpResponse.getStatusLine();
        this.statusCode = statusLine.getStatusCode();
        try { 
            getStringEntity(); 
        } catch (IOException ex) {
            Logger.getLogger(Response.class.getName()).log(Level.SEVERE, null, ex);
        } 
 
        if (parseStringEntityForJson()) { 
            JsonParser.parseForErrors(jsonResponse);
        } else if (parseStringEntityForParameters()) { 
        } 
 
        switch (statusCode) {
            case (200): { 
                return true; 
            } 
            case (401): { 
                OAuthException unauthorizedClientException = new UnauthorizedClientException(statusLine.getReasonPhrase());
                unauthorizedClientException.setErrorDescription(this.httpResponse.getFirstHeader("WWW-Authenticate").getValue());
                return false; 
            } 
        } 
        return true; 
Connect your IDE to all the code out there  Get Codota for Java