roboto.http.options
Module Contents
HttpClientOptions
Behavior of a HttpClient, applied to every request it makes.
Attributes
HttpClientOptions.logging
HttpClientOptions.retry
HttpLoggingOptions
How a HttpClient renders requests into its logs.
Attributes
HttpLoggingOptions.scrub_headers
Header names, compared case-insensitively, whose values are replaced with * in every rendered form of a request the client produces. Authorization is always scrubbed, with or without an entry here.
HttpRetryOptions
Whether and how many times a HttpClient retries a failed request.
Attributes
HttpRetryOptions.max_attempts
Total attempts per request, first try included. Values below 1 behave as 1: the first attempt always runs.
HttpRetryOptions.predicate
Called with the request and the exception a failed attempt raised; True means try again. None keeps the default, is_expected_to_be_transient(), which retries failures expected to be transient: DNS resolution failures unconditionally; connection errors, timeouts, and retryable HTTP statuses according to the request’s idempotency.
RetryPredicate
Decides whether the exception warrants another attempt at the request.
never_retry()
Retry predicate giving every request exactly one attempt.
Use for calls whose side effect must not run twice and where the server offers no idempotency key: a retried delivery (a chat message, an email) lands as a duplicate.
Parameters
_request roboto._exc BaseExceptionReturn type