Package org.apache.http.impl.client

Examples of org.apache.http.impl.client.ContentEncodingHttpClient


            throw new RuntimeException("Test failed with seed " + seed, e);
        }
    }

    public void runTest(final String theMessage) throws IOException {
        ContentEncodingHttpClient client = new ContentEncodingHttpClient();
        try {
            message = theMessage;
            HttpGet get = new HttpGet(DefaultServer.getDefaultServerURL() + "/path");
            get.setHeader(Headers.ACCEPT_ENCODING_STRING, "gzip");
            HttpResponse result = client.execute(get);
            Assert.assertEquals(200, result.getStatusLine().getStatusCode());
            Header[] header = result.getHeaders(Headers.CONTENT_ENCODING_STRING);
            Assert.assertEquals("gzip", header[0].getValue());
            final String body = HttpClientUtils.readResponse(result);
            Assert.assertEquals(theMessage, body);
        } finally {
            client.getConnectionManager().shutdown();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.http.impl.client.ContentEncodingHttpClient

Copyright © 2018 www.massapicom. 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.