Code example for HttpContext

Methods: removeAttribute

0
        return new BufferingNHttpEntity(response.getEntity(),
                new HeapByteBufferAllocator()); 
    } 
 
    public void handleResponse(final HttpResponse response, final HttpContext context) {
        Job testjob = (Job) context.removeAttribute("job");
        if (testjob == null) {
            throw new IllegalStateException("TestJob is null");
        } 
 
        int statusCode = response.getStatusLine().getStatusCode();
        String content = null;
 
        HttpEntity entity = response.getEntity();
        if (entity != null) {
            try { 
                content = EntityUtils.toString(entity);
            } catch (IOException ex) {
                content = "I/O exception: " + ex.getMessage();
            } 
Stop searching for code, let great code find you!  Add Codota to your java IDE