Package org.apache.http.client.methods

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


     */
    @Test
    public void testDefaultContentTypeForReader() throws Exception {
        final HttpPost httpPost = new HttpPost(UriBuilder.fromUri(getBaseUri()).path("resource/plain").build());
        httpPost.setEntity(new ByteArrayEntity("value".getBytes()));
        httpPost.removeHeaders("Content-Type");

        final HttpClient httpClient = HttpClientBuilder.create().build();
        final HttpResponse response = httpClient.execute(httpPost);

        assertEquals(200, response.getStatusLine().getStatusCode());
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.