If you don't need to process cookies you can simply disable it, with org.apache.http.impl.cookie.IgnoreSpecProvider or org.apache.http.impl.cookie.IgnoreSpec depending on what API you use. Calling disableCookieManagement() on HttpClientBuilder is not enough