英文:
Implement HttpRequestRetryHandler and RequestBuilder in httpclient5
问题
我计划将我的项目更新为使用httpclient5。
在那之后,我注意到在httpclient5(5.0、5.01和5.0.2)中,他们不再有HttPRequestRetryHandler类和RequestBuilder类。
在http5中是否有任何方法或更新可不使用这些类,或者是否有一些具有相同功能的替代方法?
英文:
I plan to update my project to use httpclient5.<br>
After that I recognized in httpclient5 (5.0, 5.01 and 5.0.2), they don't have the class HttPRequestRetryHandler and RequestBuilder anymore.<br>
Is there any way or update to not use these class in http5, or do we have some alternatives with the same functions?
答案1
得分: 3
-
使用
org.apache.hc.client5.http.HttpRequestRetryStrategy
替代。 -
对于经典传输,请使用
org.apache.hc.core5.http.io.support.ClassicRequestBuilder
,对于异步传输,请使用org.apache.hc.core5.http.nio.support.AsyncRequestBuilder
。
一般而言,在从 Apache HttpClient 4.5.x 迁移到 Apache HttpClient 5.x 时,这个资源可能会很有用。
链接:https://ok2c.github.io/httpclient-migration-guide/
英文:
-
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论