-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why retry doesn't work on sesson.post method #2975
Comments
When you say it doesn't work on post, what does that mean? What are you expecting to see and what actually happens? |
it means. when i use session.post to access url = 'https://httpbin.org/status/500', it doesn't retry and just return an 500 error, not maxretry error. |
@demonguy That's not how retries work by default. Generally speaking, retries only affect actual connection issues that prevent us from sending the request or retrieving the response altogether. Normally, we do not issue retries on 500 errors. You can change that behaviour by initializing your |
I am doing what you said, did you read my original post? i past "requests.packages.urllib3.util.Retry" object. And of course i passed status_forcelist, but it only works on get, not on post |
If you look at the API documentation, you'll notice that it says this:
POST is not considered IDEMPOTENT. You'll need to extend the method whitelist with POST to allow max_retries to function there. |
@demonguy in the future questions are to be asked on StackOverflow. Please do not ask a question in an issue again. |
Sorry. I search for the whole Request document, i should expect it's in urllib3 documents. |
I've pasted requests.packages.urllib3.util.Retry object to max_retries argument of HTTPAdapter
But i found, it only works on session.get. How could i make it work on session.post ?
The text was updated successfully, but these errors were encountered: