Code example for BufferedHttpEntity

0
        String responseBody = null;
        try { 
            HttpEntity entity = null;
            HttpEntity temp = response.getEntity();
            if(temp != null) {
                entity = new BufferedHttpEntity(temp);
            } 
            responseBody = EntityUtils.toString(entity,"UTF-8");
        } catch(IOException e) {
            sendFailureMessage(e, null);
        } 
 
        if(status.getStatusCode() >= 300) {
            sendFailureMessage(new HttpResponseException(status.getStatusCode(), status.getReasonPhrase()), responseBody);
        } else { 
            sendSuccessMessage(responseBody);
        } 
    } 
} 
Experience pair programming with AI  Get Codota for Java