Disable cookie management spring boot 3 RestTemplateBuilder

176 views Asked by At

I am migrating from Spring Boot 2 -> Spring Boot 3

I had such method for getting the restTemplateBuilder to disable cookie management.

public static RestTemplateBuilder getRestTemplateBuilder() {
    return new RestTemplateBuilder()
        .requestFactory(() -> new HttpComponentsClientHttpRequestFactory(
            HttpClientBuilder
                .create()
                .disableCookieManagement()
                .build()));
}

Now such method returns CloseableHttpClient instead

HttpClientBuilder.create().disableCookieManagement().build()

But the new HttpComponentsClientHttpRequestFactory( expects HttpClient instead.

0

There are 0 answers