Skip to content

httpx

httpx module containing classes related to httpx.

RetryTransport

RetryTransport(
    retries=0,
    delay=1,
    status_forcelist=None,
    allowed_methods=None,
    **kwargs
)

Bases: httpx.HTTPTransport

httpx transport that enables retries in case of failed http requests.

Parameters:

  • retries (int) –

    Number of total retries if request is failing.

  • delay (int) –

    Delay between retries in seconds.

  • status_forcelist (typing.Optional[typing.List[int]]) –

    Response status that should trigger a retry.

  • allowed_methods (typing.Optional[typing.List[str]]) –

    HTTP methods for which retries are enabled.

retries instance-attribute

retries = retries

delay instance-attribute

delay = delay

status_forcelist instance-attribute

status_forcelist = status_forcelist or []

allowed_methods instance-attribute

allowed_methods = allowed_methods or []

handle_request

handle_request(request)

Executes request and performs retries if necessary and enabled.