How can I disable default request headers from apache httpclient 4?

前端 未结 4 1633
终归单人心
终归单人心 2020-12-14 21:55

I am using apache common httpclient 4.3.3 to make http 1.0 request. Here is how I make the request

HttpClient client = HttpClientBuilder.create().build();
Ht         


        
4条回答
  •  一个人的身影
    2020-12-14 22:38

    CloseableHttpClient hc = HttpClients.custom()
            .setHttpProcessor(HttpProcessorBuilder.create().build())
            .build();
    

    The code snippet above demonstrates how to create an HttpClient instance with an empty (no-op) protocol processor, which guarantees no request headers will ever be added to outgoing messages executed by such client

提交回复
热议问题