requests_retry_session¶
- documenteer.requestsutils.requests_retry_session(retries=3, backoff_factor=0.3, status_forcelist=(500, 502, 504), session=None)¶
Create a requests session that handles errors by retrying.
- Parameters
- Returns
session – Requests session that can take
get
andpost
methods, for example.- Return type
requests.Session
Notes
This function is based on https://www.peterbe.com/plog/best-practice-with-retries-with-requests by Peter Bengtsson.