HttpClient WARNING: Cookie rejected: Illegal domain attribute

前端 未结 7 785
慢半拍i
慢半拍i 2020-12-09 03:36

I\'m using HttpClient latest version (4.x). And right now I\'m trying to do A GET Request. I just posting a Get request.

This is my Code;

public clas         


        
7条回答
  •  一整个雨季
    2020-12-09 04:02

    I am using http client 4.5.2 and this is set cookie spec to easy solved my problem. The example of how instantiate client:

    httpClient = HttpClients.custom()
                    .setDefaultRequestConfig(RequestConfig.custom()
                            // Waiting for a connection from connection manager
                            .setConnectionRequestTimeout(10000)
                            // Waiting for connection to establish
                            .setConnectTimeout(5000)
                            .setExpectContinueEnabled(false)
                            // Waiting for data
                            .setSocketTimeout(5000)
                            .setCookieSpec("easy")
                            .build())
                    .setMaxConnPerRoute(20)
                    .setMaxConnTotal(100)
                    .build();
    

提交回复
热议问题