Search code examples
javahttpclientapache-httpclient-5.x

Implement HttpRequestRetryHandler and RequestBuilder in httpclient5


I plan to update my project to use httpclient5.
After that I recognized in httpclient5 (5.0, 5.01 and 5.0.2), they don't have the class HttPRequestRetryHandler and RequestBuilder anymore.
Is there any way or update to not use these class in http5, or do we have some alternatives with the same functions?


Solution

    1. Use org.apache.hc.client5.http.HttpRequestRetryStrategy instead.

    2. Use org.apache.hc.core5.http.io.support.ClassicRequestBuilder with the classic transport and org.apache.hc.core5.http.nio.support.AsyncRequestBuilder with the async transport.

    Generally this resource might prove useful when migrating from Apache HttpClient 4.5.x to Apache HttpClient 5.x

    https://ok2c.github.io/httpclient-migration-guide/