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?
Asked
Active
Viewed 884 times
3

Thanh Huy Le
- 89
- 1
- 8
1 Answers
3
Use
org.apache.hc.client5.http.HttpRequestRetryStrategy
instead.Use
org.apache.hc.core5.http.io.support.ClassicRequestBuilder
with the classic transport andorg.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

ok2c
- 26,450
- 5
- 63
- 71
-
It works flawlessly, except the ClassicRequestBuilder doesn't have the setConfig(method). Do you have any suggestion, ok2c? – Thanh Huy Le Oct 05 '20 at 07:10
-
1Please use `HttpClientContext#setRequestConfig` instead – ok2c Oct 06 '20 at 06:59