1

我在项目中使用了 Jersey Client,如下所示:

clientConfig.connectorProvider(new ApacheConnectorProvider());
clientConfig.register(MultiPartFeature.class);
客户端 = ClientBuilder.newClient(clientConfig);

它实际上使用 httpClient 来完成这项工作。但现在我在这个问题中遇到了 CookieSpec 问题:Fixing HttpClient warning “Invalid expires attribute” using fluent API。我需要更改 CookieSpec,但找不到更改配置的位置。

4

1 回答 1

1

或许你可以尝试使用下面的解决方案:</p>

RequestConfig requestConfig = RequestConfig.custom()
                .setCookieSpec(CookieSpecs.STANDARD).build();
        clientConfig.property(ApacheClientProperties.REQUEST_CONFIG, requestConfig);
于 2020-09-17T05:07:32.853 回答