Package org.apache.http.message

Examples of org.apache.http.message.BasicHttpResponse.addHeader()


        assertFalse(reuseStrategy.keepAlive(response, context));
    }

    public void testHTTP11Default() throws Exception {
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        response.addHeader("Content-Length", "10");
        assertTrue(reuseStrategy.keepAlive(response, context));
    }

    public void testFutureHTTP() throws Exception {
        HttpResponse response = new BasicHttpResponse(new HttpVersion(3, 45), 200, "OK");
View Full Code Here


        assertTrue(reuseStrategy.keepAlive(response, context));
    }

    public void testFutureHTTP() throws Exception {
        HttpResponse response = new BasicHttpResponse(new HttpVersion(3, 45), 200, "OK");
        response.addHeader("Content-Length", "10");

        assertTrue(reuseStrategy.keepAlive(response, context));
    }

    public void testBrokenConnectionDirective1() throws Exception {
View Full Code Here

    }

    public void testBrokenConnectionDirective1() throws Exception {
        // Use HTTP 1.0
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_0, 200, "OK");
        response.addHeader("Content-Length", "10");
        response.addHeader("Connection", "keep--alive");

        assertFalse(reuseStrategy.keepAlive(response, context));
    }
View Full Code Here

    public void testBrokenConnectionDirective1() throws Exception {
        // Use HTTP 1.0
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_0, 200, "OK");
        response.addHeader("Content-Length", "10");
        response.addHeader("Connection", "keep--alive");

        assertFalse(reuseStrategy.keepAlive(response, context));
    }

    public void testBrokenConnectionDirective2() throws Exception {
View Full Code Here

    }

    public void testBrokenConnectionDirective2() throws Exception {
        // Use HTTP 1.0
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_0, 200, "OK");
        response.addHeader("Content-Length", "10");
        response.addHeader("Connection", null);

        assertFalse(reuseStrategy.keepAlive(response, context));
    }
View Full Code Here

    public void testBrokenConnectionDirective2() throws Exception {
        // Use HTTP 1.0
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_0, 200, "OK");
        response.addHeader("Content-Length", "10");
        response.addHeader("Connection", null);

        assertFalse(reuseStrategy.keepAlive(response, context));
    }

    public void testConnectionTokens1() throws Exception {
View Full Code Here

    }

    public void testConnectionTokens1() throws Exception {
        // Use HTTP 1.1
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        response.addHeader("Transfer-Encoding", "chunked");
        response.addHeader("Connection", "yadda, cLOSe, dumdy");

        assertFalse(reuseStrategy.keepAlive(response, context));
    }
View Full Code Here

    public void testConnectionTokens1() throws Exception {
        // Use HTTP 1.1
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        response.addHeader("Transfer-Encoding", "chunked");
        response.addHeader("Connection", "yadda, cLOSe, dumdy");

        assertFalse(reuseStrategy.keepAlive(response, context));
    }

    public void testConnectionTokens2() throws Exception {
View Full Code Here

    }

    public void testConnectionTokens2() throws Exception {
        // Use HTTP 1.1
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        response.addHeader("Transfer-Encoding", "chunked");
        response.addHeader("Connection", "yadda, kEEP-alive, dumdy");

        assertTrue(reuseStrategy.keepAlive(response, context));
    }
View Full Code Here

    public void testConnectionTokens2() throws Exception {
        // Use HTTP 1.1
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        response.addHeader("Transfer-Encoding", "chunked");
        response.addHeader("Connection", "yadda, kEEP-alive, dumdy");

        assertTrue(reuseStrategy.keepAlive(response, context));
    }

    public void testConnectionTokens3() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.