Skip to content

Commit 4d5b029

Browse files
Add retry_on_timeout parameter to AsyncClient
1 parent 435e1da commit 4d5b029

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

httpx/_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,9 @@ class AsyncClient(BaseClient):
13481348
* **default_encoding** - *(optional)* The default encoding to use for decoding
13491349
response text, if no charset information is included in a response Content-Type
13501350
header. Set to a callable for automatic character set detection. Default: "utf-8".
1351+
* **retry_on_timeout** - *(optional)* Automatically retry requests that timeout.
1352+
When enabled, the client will retry the request up to 3 times with exponential
1353+
backoff. Defaults to `False`.
13511354
"""
13521355

13531356
def __init__(
@@ -1372,6 +1375,7 @@ def __init__(
13721375
transport: AsyncBaseTransport | None = None,
13731376
trust_env: bool = True,
13741377
default_encoding: str | typing.Callable[[bytes], str] = "utf-8",
1378+
retry_on_timeout: bool = False,
13751379
) -> None:
13761380
super().__init__(
13771381
auth=auth,

0 commit comments

Comments
 (0)