From fd326e67c6d6036f91e6e7b08e92d30359b4fc1b Mon Sep 17 00:00:00 2001 From: Petro Verkhogliad Date: Thu, 28 Nov 2024 16:04:10 -0500 Subject: [PATCH] Change timeout values to be ints Timeout values are specified as `Timeout | int | None` in `get` and etc. `httpx.Timeout` however accepts value of `float` type. --- docs/advanced/timeouts.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/advanced/timeouts.md b/docs/advanced/timeouts.md index aedcfb627f..29a3756f8a 100644 --- a/docs/advanced/timeouts.md +++ b/docs/advanced/timeouts.md @@ -9,11 +9,11 @@ You can set timeouts for an individual request: ```python # Using the top-level API: -httpx.get('http://example.com/api/v1/example', timeout=10.0) +httpx.get('http://example.com/api/v1/example', timeout=10) # Using a client instance: with httpx.Client() as client: - client.get("http://example.com/api/v1/example", timeout=10.0) + client.get("http://example.com/api/v1/example", timeout=10) ``` Or disable timeouts for an individual request: @@ -68,4 +68,4 @@ timeout = httpx.Timeout(10.0, connect=60.0) client = httpx.Client(timeout=timeout) response = client.get('http://example.com/') -``` \ No newline at end of file +```