- 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.
int, optional) – Number of retries to attempt.
float, optional) – Backoff factor.
status_forcelist (sequence of
str, optional) – Status codes that must be retried.
requests.Session) – An existing requests session to configure.
session – Requests session that can take
postmethods, for example.
- Return type:
This function is based on https://www.peterbe.com/plog/best-practice-with-retries-with-requests by Peter Bengtsson.