Code example for BasicHttpResponse

Methods: addHeader

0
        Assert.assertFalse(reuseStrategy.keepAlive(response, context));
    } 
 
    @Test 
    public void testChunkedContent() throws Exception { 
        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        response.addHeader("Transfer-Encoding", "chunked");
        Assert.assertTrue(reuseStrategy.keepAlive(response, context));
    } 
 
    @Test 
    public void testIgnoreInvalidKeepAlive() throws Exception { 
        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_0, 200, "OK");
        response.addHeader("Connection", "keep-alive");
        Assert.assertFalse(reuseStrategy.keepAlive(response, context));
    } 
 
    @Test 
    public void testExplicitClose() throws Exception { 
        // Use HTTP 1.1 
        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");