实现HttpRequestRetryHandler和RequestBuilder在httpclient5中。

huangapple go评论73阅读模式
英文:

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

  1. 使用 org.apache.hc.client5.http.HttpRequestRetryStrategy 替代。

  2. 对于经典传输,请使用 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/

英文:
  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/

huangapple
  • 本文由 发表于 2020年10月1日 06:47:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/64146775.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定