Skip to content
Myr

compatibility.md

This file

Path

docs/compatibility.md

21 lines · 1.0 KiB · Markdown

Last changed by

Tweaks (#89)Tom Christiebefore adoption7c6fb5c

History of this file

Take it

http3 (#86)Tom Christiebefore adoptionc9747aa

lines 1–6why, one step back
1# Requests Compatibility Guide
23HTTP3 aims to be compatible with the `requests` API wherever possible.45This documentation outlines places where the API differs...6

Tweaks (#89)Tom Christiebefore adoption7c6fb5c

lines 7–21why, one step back
7## QuickStart
89Pretty much all the API mentioned in the `requests` QuickStart should be identical10to the API in our own documentation. The following exceptions apply:1112* `Response.url` - Returns a `URL` instance, rather than a string. Use `str(response.url)` if you need a string instance.13* `Response.status_code` - Returns an integer, which may be a `StatusCode` IntEnum. This has the same behaviour as any other integer, except that it provides more information in the instance representation.14* `http3.codes` - In our documentation we prefer the uppercased versions, such as `codes.NOT_FOUND`,15but also provide lower-cased versions for API compatibility with `requests`.16* `stream=True`. - Streaming responses provide the `.stream()` and `.raw()` byte iterator interfaces, rather than the `.iter_content()` method and the `.raw` socket interface.1718## Advanced Usage1920!!! warning21 TODO