httpx-retries: A retry layer for httpx #3484
will-ockmore
started this conversation in
Show and tell
Replies: 1 comment
-
Hey! LGTM, good job 🎉 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! I've just released the first version of httpx-retries - a retry layer for HTTPX.
It's very common to deal with flaky and unreliable APIs. When requests fail, your program needs to be able to retry them.
Motivation
HTTPX doesn't support this by default - the emphasis in the documentation is to use a third party library if you need more than connection retries. HTTPX Retries is focused on retrying failed requests where a response has been received.
The familiar approach, for those who have used
requests
andurllib3
, is to use urllib3's Retry utility (as shown in the requests documentation). To keep it simple to migrate from requests to HTTPX, the retry configuration uses an API that closely mirrors urllib3's Retry.Usage
Install HTTPX Retries using pip:
To get started, add the transport to your client:
Async usage is just as straightforward.
If you want to use a specific retry strategy, provide a
Retry
configuration:See the documentation for more information.
I hope you like it!
Thanks for taking the time to read. I'd love to hear about anyone who might make use of this, or if you have any feedback or ideas for the project!
Beta Was this translation helpful? Give feedback.
All reactions