Package org.apache.http

Examples of org.apache.http.HttpRequest.removeHeaders()


        request = new BasicHttpRequest("GET", "/foo", new ProtocolVersion("HTTP", 1, 2));
        request.removeHeaders("Connection");
        request.addHeader("X-Unknown-Header", "some-value");

        HttpRequest downgraded = new BasicHttpRequest("GET", "/foo", HttpVersion.HTTP_1_1);
        downgraded.removeHeaders("Connection");
        downgraded.addHeader("X-Unknown-Header", "some-value");

        RequestWrapper downgradedWrapper = new RequestWrapper(downgraded);

        EasyMock.expect(
View Full Code Here


        resp1.setHeader("Vary","Accept-Encoding");

        backendExpectsAnyRequest().andReturn(resp1);

        HttpRequest req2 = new BasicHttpRequest("GET","/",HttpVersion.HTTP_1_1);
        req2.removeHeaders("Accept-Encoding");

        HttpResponse resp2 = HttpTestUtils.make200Response();
        resp2.setHeader("ETag","\"etag1\"");
        resp2.setHeader("Cache-Control","max-age=3600");
View Full Code Here

        request = new BasicHttpRequest("GET", "/foo", new ProtocolVersion("HTTP", 1, 2));
        request.removeHeaders("Connection");
        request.addHeader("X-Unknown-Header", "some-value");

        HttpRequest downgraded = new BasicHttpRequest("GET", "/foo", HttpVersion.HTTP_1_1);
        downgraded.removeHeaders("Connection");
        downgraded.addHeader("X-Unknown-Header", "some-value");

        RequestWrapper downgradedWrapper = new RequestWrapper(downgraded);

        EasyMock.expect(
View Full Code Here

                        EntityUtils.consume(entity);
                    } else {
                        conn.close();
                    }
                    // discard previous auth header
                    connect.removeHeaders(AUTH.PROXY_AUTH_RESP);
                } else {
                    break;
                }
            } else {
                break;
View Full Code Here

                if (request == null) {
                    throw new IllegalStateException("HTTP request is null");
                }
               
                // Remove hop-by-hop headers
                request.removeHeaders(HTTP.CONTENT_LEN);
                request.removeHeaders(HTTP.TRANSFER_ENCODING);
                request.removeHeaders(HTTP.CONN_DIRECTIVE);
                request.removeHeaders("Keep-Alive");
                request.removeHeaders("Proxy-Authenticate");
                request.removeHeaders("Proxy-Authorization");
View Full Code Here

                    throw new IllegalStateException("HTTP request is null");
                }
               
                // Remove hop-by-hop headers
                request.removeHeaders(HTTP.CONTENT_LEN);
                request.removeHeaders(HTTP.TRANSFER_ENCODING);
                request.removeHeaders(HTTP.CONN_DIRECTIVE);
                request.removeHeaders("Keep-Alive");
                request.removeHeaders("Proxy-Authenticate");
                request.removeHeaders("Proxy-Authorization");
                request.removeHeaders("TE");
View Full Code Here

                }
               
                // Remove hop-by-hop headers
                request.removeHeaders(HTTP.CONTENT_LEN);
                request.removeHeaders(HTTP.TRANSFER_ENCODING);
                request.removeHeaders(HTTP.CONN_DIRECTIVE);
                request.removeHeaders("Keep-Alive");
                request.removeHeaders("Proxy-Authenticate");
                request.removeHeaders("Proxy-Authorization");
                request.removeHeaders("TE");
                request.removeHeaders("Trailers");
View Full Code Here

               
                // Remove hop-by-hop headers
                request.removeHeaders(HTTP.CONTENT_LEN);
                request.removeHeaders(HTTP.TRANSFER_ENCODING);
                request.removeHeaders(HTTP.CONN_DIRECTIVE);
                request.removeHeaders("Keep-Alive");
                request.removeHeaders("Proxy-Authenticate");
                request.removeHeaders("Proxy-Authorization");
                request.removeHeaders("TE");
                request.removeHeaders("Trailers");
                request.removeHeaders("Upgrade");
View Full Code Here

                // Remove hop-by-hop headers
                request.removeHeaders(HTTP.CONTENT_LEN);
                request.removeHeaders(HTTP.TRANSFER_ENCODING);
                request.removeHeaders(HTTP.CONN_DIRECTIVE);
                request.removeHeaders("Keep-Alive");
                request.removeHeaders("Proxy-Authenticate");
                request.removeHeaders("Proxy-Authorization");
                request.removeHeaders("TE");
                request.removeHeaders("Trailers");
                request.removeHeaders("Upgrade");
                // Remove host header
View Full Code Here

                request.removeHeaders(HTTP.CONTENT_LEN);
                request.removeHeaders(HTTP.TRANSFER_ENCODING);
                request.removeHeaders(HTTP.CONN_DIRECTIVE);
                request.removeHeaders("Keep-Alive");
                request.removeHeaders("Proxy-Authenticate");
                request.removeHeaders("Proxy-Authorization");
                request.removeHeaders("TE");
                request.removeHeaders("Trailers");
                request.removeHeaders("Upgrade");
                // Remove host header
                request.removeHeaders(HTTP.TARGET_HOST);
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.