Skip to content
Myr

Mention default timeout differences from Requests in compatibility docs (#2433)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

I was recently migrating a project from Requests to HTTPX, and I stumbled a bit on the default socket timeouts being different between the two, which I haven't seen explicitly mentioned anywhere. This adds a mention of those differences to the compatibility section, feel free to edit it or move it around as you choose.

authored by František Nesveda · committed by GitHub · parent 8752e26 · Browse files · 1 file+10 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−0 removed

  • other:+10 added−0 removed

1 file+10 added−0 removed

modified:docs/compatibility.md+10 added
143 unmodified lines
144* `.iter_lines()` - Corresponding to `response.iter_lines()`145* `.iter_raw()` - Use this instead of `response.raw`146* `.read()` - Read the entire response body, making `request.text` and `response.content` available.147148## Timeouts149150HTTPX defaults to including reasonable [timeouts](quickstart.md#timeouts) for all network operations, while Requests has no timeouts by default.151152To get the same behavior as Requests, set the `timeout` parameter to `None`:153154```python155httpx.get('https://www.example.com', timeout=None)156```157158## Proxy keys159160When using `httpx.Client(proxies={...})` to map to a selection of different proxies, we use full URL schemes, such as `proxies={"http://": ..., "https://": ...}`.161
59 unmodified lines