Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpRequestWrapper.removeHeaders()


        backendExpectsAnyRequestAndReturn(resp1);

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

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


            if (needAuthentication(state)) {
                // discard previous auth headers
                final HttpRequestWrapper currentRequest = state.getCurrentRequest();
                final HttpRequest original = currentRequest.getOriginal();
                if (!original.containsHeader(AUTH.WWW_AUTH_RESP)) {
                    currentRequest.removeHeaders(AUTH.WWW_AUTH_RESP);
                }
                if (!original.containsHeader(AUTH.PROXY_AUTH_RESP)) {
                    currentRequest.removeHeaders(AUTH.PROXY_AUTH_RESP);
                }
                return true;
View Full Code Here

                final HttpRequest original = currentRequest.getOriginal();
                if (!original.containsHeader(AUTH.WWW_AUTH_RESP)) {
                    currentRequest.removeHeaders(AUTH.WWW_AUTH_RESP);
                }
                if (!original.containsHeader(AUTH.PROXY_AUTH_RESP)) {
                    currentRequest.removeHeaders(AUTH.PROXY_AUTH_RESP);
                }
                return true;
            }
        }
        if (config.isRedirectsEnabled()) {
View Full Code Here

        request.removeHeaders("Connection");
        request.addHeader("X-Unknown-Header", "some-value");

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

        EasyMock.expect(
                mockBackend.execute(
                        EasyMock.isA(HttpRoute.class),
View Full Code Here

        backendExpectsAnyRequestAndReturn(resp1);

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

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

        request.removeHeaders("Connection");
        request.addHeader("X-Unknown-Header", "some-value");

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

        EasyMock.expect(
                mockBackend.execute(
                        EasyMock.isA(HttpRoute.class),
View Full Code Here

        request.removeHeaders("Connection");
        request.addHeader("X-Unknown-Header", "some-value");

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

        EasyMock.expect(
                mockBackend.execute(
                        EasyMock.isA(HttpRoute.class),
View Full Code Here

        backendExpectsAnyRequestAndReturn(resp1);

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

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

            if (needAuthentication(state)) {
                // discard previous auth headers
                final HttpRequestWrapper currentRequest = state.getCurrentRequest();
                final HttpRequest original = currentRequest.getOriginal();
                if (!original.containsHeader(AUTH.WWW_AUTH_RESP)) {
                    currentRequest.removeHeaders(AUTH.WWW_AUTH_RESP);
                }
                if (!original.containsHeader(AUTH.PROXY_AUTH_RESP)) {
                    currentRequest.removeHeaders(AUTH.PROXY_AUTH_RESP);
                }
                return true;
View Full Code Here

                final HttpRequest original = currentRequest.getOriginal();
                if (!original.containsHeader(AUTH.WWW_AUTH_RESP)) {
                    currentRequest.removeHeaders(AUTH.WWW_AUTH_RESP);
                }
                if (!original.containsHeader(AUTH.PROXY_AUTH_RESP)) {
                    currentRequest.removeHeaders(AUTH.PROXY_AUTH_RESP);
                }
                return true;
            }
        }
        if (config.isRedirectsEnabled()) {
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.