index.md
This file
Path
docs/index.md
144 lines · 4.1 KiB · Markdown
Last changed by
Version 0.16 (#1347)Tom Christiebefore adoptiondbbcf43
History of this fileTake it
The walk stopped after 200 commits: lines older than 66a4537 point at it.
Add mypy config for tests directory (#991)Florimond Mancabefore adoption66a4537
lines 1–29why, one step back1<p align="center" style="margin: 0 0 10px">2 <img width="350" height="208" src="https://raw.githubusercontent.com/encode/httpx/master/docs/img/logo.jpg" alt='HTTPX'>3</p>45<h1 align="center" style="font-size: 3rem; margin: -15px 0">6HTTPX7</h1>89---1011<div align="center">12<p>13<a href="https://github.com/encode/httpx/actions">14 <img src="https://github.com/encode/httpx/workflows/Test%20Suite/badge.svg" alt="Test Suite">15</a>16<a href="https://pypi.org/project/httpx/">17 <img src="https://badge.fury.io/py/httpx.svg" alt="Package version">18</a>19</p>2021<em>A next-generation HTTP client for Python.</em>22</div>2324HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2.252627!!! note28 HTTPX should currently be considered in beta.29Version 0.16 (#1347)Tom Christiebefore adoptiondbbcf43
line 30why, one step back30 We believe we've got the public API to a stable point now, but would strongly recommend pinning your dependencies to the `0.16.*` release, so that you're able to properly review [API changes between package updates](https://github.com/encode/httpx/blob/master/CHANGELOG.md).Add mypy config for tests directory (#991)Florimond Mancabefore adoption66a4537
line 31why, one step back31Adjust 1.0 expectations. (#1202)Tom Christiebefore adoptionf4b407a
line 32why, one step back32 A 1.0 release is expected to be issued sometime in late 2020.Add mypy config for tests directory (#991)Florimond Mancabefore adoption66a4537
lines 33–37why, one step back3334---3536Let's get started...37Use pycon for Python console code blocks (#1187)Hugo van Kemenadebefore adoptiond10b7cd
line 38why, one step back38```pyconAdd mypy config for tests directory (#991)Florimond Mancabefore adoption66a4537
lines 39–54why, one step back39>>> import httpx40>>> r = httpx.get('https://www.example.org/')41>>> r42<Response [200 OK]>43>>> r.status_code4420045>>> r.headers['content-type']46'text/html; charset=UTF-8'47>>> r.text48'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'49```5051Or, using the async API...5253_Use [IPython](https://ipython.readthedocs.io/en/stable/) or Python 3.8+ with `python -m asyncio` to try this code interactively._54Use pycon for Python console code blocks (#1187)Hugo van Kemenadebefore adoptiond10b7cd
line 55why, one step back55```pyconAdd mypy config for tests directory (#991)Florimond Mancabefore adoption66a4537
lines 56–73why, one step back56>>> import httpx57>>> async with httpx.AsyncClient() as client:58>>> r = await client.get('https://www.example.org/')59>>> r60<Response [200 OK]>61```6263## Features6465HTTPX is a high performance asynchronous HTTP client, that builds on the66well-established usability of `requests`, and gives you:6768* A broadly [requests-compatible API](compatibility.md).69* Standard synchronous interface, but with [async support if you need it](async.md).70* HTTP/1.1 [and HTTP/2 support](http2.md).71* Ability to make requests directly to [WSGI applications](advanced.md#calling-into-python-web-apps) or [ASGI applications](async.md#calling-into-python-web-apps).72* Strict timeouts everywhere.73* Fully type annotated.Update README.md (#1291)Tom Christiebefore adoptionff0febb
line 74why, one step back74* 100% test coverage.Add mypy config for tests directory (#991)Florimond Mancabefore adoption66a4537
lines 75–110why, one step back7576Plus all the standard features of `requests`...7778* International Domains and URLs79* Keep-Alive & Connection Pooling80* Sessions with Cookie Persistence81* Browser-style SSL Verification82* Basic/Digest Authentication83* Elegant Key/Value Cookies84* Automatic Decompression85* Automatic Content Decoding86* Unicode Response Bodies87* Multipart File Uploads88* HTTP(S) Proxy Support89* Connection Timeouts90* Streaming Downloads91* .netrc Support92* Chunked Requests9394## Documentation9596For a run-through of all the basics, head over to the [QuickStart](quickstart.md).9798For more advanced topics, see the [Advanced Usage](advanced.md) section,99the [async support](async.md) section, or the [HTTP/2](http2.md) section.100101The [Developer Interface](api.md) provides a comprehensive API reference.102103To find out about tools that integrate with HTTPX, see [Third Party Packages](third-party-packages.md).104105## Dependencies106107The HTTPX project relies on these excellent libraries:108109* `httpcore` - The underlying transport implementation for `httpx`.110 * `h11` - HTTP/1.1 support.Packaging dependancy tweaks (#1206)Joebefore adoption15c1e42
line 111why, one step back111 * `h2` - HTTP/2 support. *(Optional)*Add mypy config for tests directory (#991)Florimond Mancabefore adoption66a4537
lines 112–113why, one step back112* `certifi` - SSL certificates.113* `rfc3986` - URL parsing & normalization.Packaging dependancy tweaks (#1206)Joebefore adoption15c1e42
line 114why, one step back114 * `idna` - Internationalized domain name support.Add mypy config for tests directory (#991)Florimond Mancabefore adoption66a4537
lines 115–129why, one step back115* `sniffio` - Async library autodetection.116* `brotlipy` - Decoding for "brotli" compressed responses. *(Optional)*117118A huge amount of credit is due to `requests` for the API layout that119much of this work follows, as well as to `urllib3` for plenty of design120inspiration around the lower-level networking details.121122## Installation123124Install with pip:125126```shell127$ pip install httpx128```129HTTP/2 becomes fully optional (#1140)Tom Christiebefore adoption8d9dfb5
lines 130–133why, one step back130Or, to include the optional HTTP/2 support, use:131132```shell133$ pip install httpx[http2]Packaging dependancy tweaks (#1206)Joebefore adoption15c1e42
lines 134–139why, one step back134```135136To include the optional brotli decoder support, use:137138```shell139$ pip install httpx[brotli]HTTP/2 becomes fully optional (#1140)Tom Christiebefore adoption8d9dfb5
lines 140–141why, one step back140```141Add mypy config for tests directory (#991)Florimond Mancabefore adoption66a4537
lines 142–144why, one step back142HTTPX requires Python 3.6+143144[sync-support]: https://github.com/encode/httpx/issues/572