You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Best I can tell, today there is no way to set a default timeout at the Session level. That is, I want to create a session and give it a default timeout which should be used on any request() for the session if no timeout is given on the actual **kwargs of the request invocation.
Example:
session=requests.Session()
session.default_timeout=9
...
# default timeout of 9 is usedsession.get('http://thehost/good-stuff')
# passed value of 3 is usedsession.get('http://thehost/good-stuff', timeout=3)
This would be very helpful for consumers wanting to pool request sessions above the requests lib layer using common kwargs for all requests in the session(s).
The text was updated successfully, but these errors were encountered:
Hi @bodenr thanks for using requests and stopping by with this feature request.
The library strives to make very specific divides in what is appropriate to add where. Timeout values being specified on a session do not make very much sense to the project although it's plausible for you to add some code to do this (like pip) has.
In the future please search for closed and open issues discussing your topics. A quick search immediately brought up https://github.com/kennethreitz/requests/issues/2011 which was closed over a year ago. I'm sure there are others, but you can find them too with a quick search.
Best I can tell, today there is no way to set a default timeout at the Session level. That is, I want to create a session and give it a default timeout which should be used on any request() for the session if no timeout is given on the actual **kwargs of the request invocation.
Example:
This would be very helpful for consumers wanting to pool request sessions above the requests lib layer using common kwargs for all requests in the session(s).
The text was updated successfully, but these errors were encountered: