Code example for HttpResponse

Methods: getFirstHeader

0
        HttpEntity entity = httpResponse.getEntity();
        this.stringResponse = EntityUtils.toString(entity, EntityUtils.getContentCharSet(entity));
    } 
 
    private boolean parseStringEntityForJson() { 
        if (httpResponse.getFirstHeader("Content-Type").getValue().equalsIgnoreCase("application/json")) {
            if (stringResponse != null && !stringResponse.isEmpty()) {
                try { 
                    jsonResponse = new JSONObject(stringResponse);
                } catch (JSONException ex) {
                    return false; 
                } 
                return true; 
            } 
        } 
        return false; 
    } 
 
    private boolean parseStringEntityForParameters() 
        throws JSONException, InvalidRequestException, 
               InvalidClientException, InvalidGrantException,