Retry on HttpCode
See original GitHub issueSubsystem Client
Is your feature request related to a problem? Please describe. Sometimes external service returns 500/502 errors, however next call can be successful. In this case do connection retry after a small delay.
Describe the solution you’d like
I’d like to have separate Ktor Client feature to automate these retries. For example, it can get handler like needRetry: Response -> Bool
on input and configurable retry pauses and retry count.
Motivation to include to ktor Of course retries can be implemented above the call. However client can do them better, because:
- It can preserve low-level resources (like data buffers, resolved headers, etc.)
- It already does retry logic on 401 responses
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:12 (3 by maintainers)
Top Results From Across the Web
HTTP statuscode to retry same request - Stack Overflow
Is there an HTTP status code to instruct a client to perform the same request again? I am facing a situation where the...
Read more >Retry-After - HTTP - MDN Web Docs
The Retry-After response HTTP header indicates how long the user agent should wait before making a follow-up request.
Read more >HTTP headers | Retry-After - GeeksforGeeks
HTTP Retry-After header is an HTTP response header which indicates how long to wait before making another request.
Read more >List of HTTP status codes - Wikipedia
This is a list of Hypertext Transfer Protocol (HTTP) response status codes. ... 449 Retry With: The server cannot honour the request because...
Read more >HTTP Status Codes - REST API Tutorial
If the condition is temporary, the server SHOULD include a Retry- After header field to indicate that it is temporary and after what...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @imanushin. Thanks for the report, it’s good idea. The retry mechanism is implemented in the
HttpSend
feature, it looks easy to introduce the feature to use it.The PR is waiting for a review 😃 after that we can solve this issue