index.md
This file
Path
docs/index.md
134 lines · 4.0 KiB · Markdown
Last changed by
Version 0.12 (#852)Tom Christiebefore adoption6e40c1b
History of this fileTake it
The walk stopped after 200 commits: lines older than e3140a0 point at it.
Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
lines 1–26why, 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://travis-ci.org/encode/httpx">14 <img src="https://travis-ci.org/encode/httpx.svg?branch=master" alt="Build Status">15</a>16<a href="https://codecov.io/gh/encode/httpx">17 <img src="https://codecov.io/gh/encode/httpx/branch/master/graph/badge.svg" alt="Coverage">18</a>19<a href="https://pypi.org/project/httpx/">20 <img src="https://badge.fury.io/py/httpx.svg" alt="Package version">21</a>22</p>2324<em>A next-generation HTTP client for Python.</em>25</div>26Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 27why, one step back27HTTPX 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.Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
line 28why, one step back28Drop sync (#544)Tom Christiebefore adoption206c537
lines 29–30why, one step back2930!!! noteProposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 31why, one step back31 HTTPX should currently be considered in beta.Drop sync (#544)Tom Christiebefore adoption206c537
line 32why, one step back32Version 0.12 (#852)Tom Christiebefore adoption6e40c1b
line 33why, one step back33 We believe we've got the public API to a stable point now, but would strongly recommend pinning your dependencies to the `0.12.*` release, so that you're able to properly review [API changes between package updates](https://github.com/encode/httpx/blob/master/CHANGELOG.md).Alpha note, and recommendations on pinning versions (#590)Tom Christiebefore adoptionc08ae77
line 34why, one step back34Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
lines 35–36why, one step back35 A 1.0 release is expected to be issued sometime on or before April 2020.36Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
lines 37–42why, one step back37---3839Let's get started...4041```python42>>> import httpxProposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 43why, one step back43>>> r = httpx.get('https://www.example.org/')Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
lines 44–53why, one step back44>>> r45<Response [200 OK]>46>>> r.status_code4720048>>> r.headers['content-type']49'text/html; charset=UTF-8'50>>> r.text51'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'52```53Add an async example to intro snippets (#750)Florimond Mancabefore adoption7d84408
lines 54–65why, one step back54Or, using the async API...5556_Use [IPython](https://ipython.readthedocs.io/en/stable/) or Python 3.8+ with `python -m asyncio` to try this code interactively._5758```python59>>> import httpx60>>> async with httpx.AsyncClient() as client:61>>> r = await client.get('https://www.example.org/')62>>> r63<Response [200 OK]>64```65Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
lines 66–67why, one step back66## Features67Drop sync (#544)Tom Christiebefore adoption206c537
lines 68–69why, one step back68HTTPX is a high performance asynchronous HTTP client, that builds on the69well-established usability of `requests`, and gives you:Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
line 70why, one step back70Use www.python-httpx.org domainTom Christiebefore adoptionb932d94
line 71why, one step back71* A broadly [requests-compatible API](compatibility.md).Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
lines 72–73why, one step back72* Standard synchronous interface, but with [async support if you need it](async.md).73* HTTP/1.1 [and HTTP/2 support](http2.md).Use www.python-httpx.org domainTom Christiebefore adoptionb932d94
line 74why, one step back74* 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).Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
lines 75–76why, one step back75* Strict timeouts everywhere.76* Fully type annotated.Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 77why, one step back77* 99% test coverage.Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
lines 78–90why, one step back7879Plus all the standard features of `requests`...8081* International Domains and URLs82* Keep-Alive & Connection Pooling83* Sessions with Cookie Persistence84* Browser-style SSL Verification85* Basic/Digest Authentication86* Elegant Key/Value Cookies87* Automatic Decompression88* Automatic Content Decoding89* Unicode Response Bodies90* Multipart File UploadsDrop sync (#544)Tom Christiebefore adoption206c537
line 91why, one step back91* HTTP(S) Proxy SupportReorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
lines 92–100why, one step back92* Connection Timeouts93* Streaming Downloads94* .netrc Support95* Chunked Requests9697## Documentation9899For a run-through of all the basics, head over to the [QuickStart](quickstart.md).100Better HTTP/2 defaults. (#584)Tom Christiebefore adoption30229f1
line 101why, one step back101For more advanced topics, see the [Advanced Usage](advanced.md) section,Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 102why, one step back102the [async support](async.md) section, or the [HTTP/2](http2.md) section.Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
lines 103–109why, one step back103104The [Developer Interface](api.md) provides a comprehensive API reference.105106## Dependencies107108The HTTPX project relies on these excellent libraries:109Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 110why, one step back110* `urllib3` - Sync client support.Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
line 111why, one step back111* `h11` - HTTP/1.1 support.Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 112why, one step back112* `h2` - HTTP/2 support.Reorganize timeout config tests (#491)Florimond Mancabefore adoptione3140a0
lines 113–132why, one step back113* `certifi` - SSL certificates.114* `chardet` - Fallback auto-detection for response encoding.115* `hstspreload` - determines whether IDNA-encoded host should be only accessed via HTTPS.116* `idna` - Internationalized domain name support.117* `rfc3986` - URL parsing & normalization.118* `brotlipy` - Decoding for "brotli" compressed responses. *(Optional)*119120A huge amount of credit is due to `requests` for the API layout that121much of this work follows, as well as to `urllib3` for plenty of design122inspiration around the lower-level networking details.123124## Installation125126Install with pip:127128```shell129$ pip install httpx130```131132HTTPX requires Python 3.6+Alpha note, and recommendations on pinning versions (#590)Tom Christiebefore adoptionc08ae77
lines 133–134why, one step back133134[sync-support]: https://github.com/encode/httpx/issues/572