compatibility.md
This file
Path
docs/compatibility.md
20 lines · 850 bytes · Markdown
Last changed by
Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b
History of this fileTake it
123456789101112131415161718192021# Requests Compatibility Guide
HTTPX aims to be compatible with the `requests` API wherever possible.
This documentation outlines places where the API differs...
## QuickStart
Pretty much all the API mentioned in the `requests` QuickStart should be identicalto the API in our own documentation. The following exceptions apply:
* `Response.url` - Returns a `URL` instance, rather than a string. Use `str(response.url)` if you need a string instance.* `httpx.codes` - In our documentation we prefer the uppercased versions, such as `codes.NOT_FOUND`,but also provide lower-cased versions for API compatibility with `requests`.* `stream=True`. - Streaming responses provide the `.stream()` and `.raw()` byte iterator interfaces, rather than the `.iter_content()` method and the `.raw` socket interface.
## Advanced Usage
!!! warning TODO