From ab9b5011cd7232294fd0162c32c9b60bb7fa6701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Mon, 7 Nov 2022 11:44:19 +0100 Subject: [PATCH] Mention default timeout differences from Requests in compatibility docs --- docs/compatibility.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/compatibility.md b/docs/compatibility.md index 2a9cbd85ef..de8f701702 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -145,6 +145,16 @@ Within a `stream()` block request data is made available with: * `.iter_raw()` - Use this instead of `response.raw` * `.read()` - Read the entire response body, making `request.text` and `response.content` available. +## Timeouts + +HTTPX defaults to including reasonable [timeouts](quickstart.md#timeouts) for all network operations, while Requests has no timeouts by default. + +To get the same behavior as Requests, set the `timeout` parameter to `None`: + +```python +httpx.get('https://www.example.com', timeout=None) +``` + ## Proxy keys When using `httpx.Client(proxies={...})` to map to a selection of different proxies, we use full URL schemes, such as `proxies={"http://": ..., "https://": ...}`.