Kong / unirest-java

Unirest in Java: Simplified, lightweight HTTP client library.
http://kong.github.io/unirest-java/
MIT License
2.58k stars 591 forks source link

Can we add a response failure retry function? #520

Closed formatsystem closed 2 months ago

formatsystem commented 3 months ago

I want to use an interceptor to resubmit the response after it fails. However, it seems that there is no relevant function or is there any good way to implement it?

### Tasks
ryber commented 3 months ago

Unirest has a retry mechanism available in the config. It is designed for use with APIs that support the retry-after header but it can be customized. See the Unirest::config::retryAfter methods in particular the one that allows you to set a RetryStrategy