index.md
This file
Path
docs/index.md
154 lines · 4.5 KiB · Markdown
Last changed by
Update index.md (#1883)Marcelo Trylesinskibefore adoptiondeb1a2b
History of this fileTake it
The walk stopped after 200 commits: lines older than ed16eb3 point at it.
Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
line 1why, one step back1<p align="center" style="margin: 0 0 10px">Update butterfly logo (#1382)Tom Christiebefore adoptionceccb96
line 2why, one step back2 <img width="350" height="208" src="https://raw.githubusercontent.com/encode/httpx/master/docs/img/butterfly.png" alt='HTTPX'>Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
lines 3–27why, one step back3</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!!! noteAdd cli support (#1855)Tom Christiebefore adoptionee9250d
line 28why, one step back28 This is the documentation for the 1.0 pre-release.Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
line 29why, one step back29Update index.md (#1883)Marcelo Trylesinskibefore adoptiondeb1a2b
line 30why, one step back30 This release adds support for an integrated command-line client, and also includes a couple of design changes from 0.19. Redirects are no longer followed by default, and the low-level Transport API has been updated. See [the CHANGELOG](https://github.com/encode/httpx/blob/master/CHANGELOG.md) for more details.Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
lines 31–33why, one step back3132---33Add cli support (#1855)Tom Christiebefore adoptionee9250d
line 34why, one step back34Installing the HTTPX 1.0 pre-release.Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
line 35why, one step back35Add cli support (#1855)Tom Christiebefore adoptionee9250d
lines 36–41why, one step back36```shell37$ pip install httpx --pre38```3940Now, let's get started...41Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
lines 42–54why, one step back42```pycon43>>> import httpx44>>> r = httpx.get('https://www.example.org/')45>>> r46<Response [200 OK]>47>>> r.status_code4820049>>> r.headers['content-type']50'text/html; charset=UTF-8'51>>> r.text52'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'53```54Add cli support (#1855)Tom Christiebefore adoptionee9250d
line 55why, one step back55Or, using the command-line client.Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
line 56why, one step back56Add cli support (#1855)Tom Christiebefore adoptionee9250d
lines 57–59why, one step back57```shell58# The command line client is an optional dependency.59$ pip install --pre 'httpx[cli]'Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
lines 60–61why, one step back60```61Add cli support (#1855)Tom Christiebefore adoptionee9250d
lines 62–69why, one step back62Which now allows us to use HTTPX directly from the command-line...63646566Sending a request...676869Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
lines 70–71why, one step back70## Features71Add cli support (#1855)Tom Christiebefore adoptionee9250d
line 72why, one step back72HTTPX builds on the well-established usability of `requests`, and gives you:Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
lines 73–79why, one step back7374* A broadly [requests-compatible API](compatibility.md).75* Standard synchronous interface, but with [async support if you need it](async.md).76* HTTP/1.1 [and HTTP/2 support](http2.md).77* 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).78* Strict timeouts everywhere.79* Fully type annotated.Update README.md (#1291)Tom Christiebefore adoptionff0febb
line 80why, one step back80* 100% test coverage.Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
lines 81–108why, one step back8182Plus all the standard features of `requests`...8384* International Domains and URLs85* Keep-Alive & Connection Pooling86* Sessions with Cookie Persistence87* Browser-style SSL Verification88* Basic/Digest Authentication89* Elegant Key/Value Cookies90* Automatic Decompression91* Automatic Content Decoding92* Unicode Response Bodies93* Multipart File Uploads94* HTTP(S) Proxy Support95* Connection Timeouts96* Streaming Downloads97* .netrc Support98* Chunked Requests99100## Documentation101102For a run-through of all the basics, head over to the [QuickStart](quickstart.md).103104For more advanced topics, see the [Advanced Usage](advanced.md) section,105the [async support](async.md) section, or the [HTTP/2](http2.md) section.106107The [Developer Interface](api.md) provides a comprehensive API reference.108Refine project workflow (#1534)Tom Christiebefore adoption437b55c
line 109why, one step back109To find out about tools that integrate with HTTPX, see [Third Party Packages](third_party_packages.md).Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
lines 110–116why, one step back110111## Dependencies112113The HTTPX project relies on these excellent libraries:114115* `httpcore` - The underlying transport implementation for `httpx`.116 * `h11` - HTTP/1.1 support.List 'click' and 'rich' in the project dependencies (#1858)Tom Christiebefore adoption7e01677
line 117why, one step back117 * `h2` - HTTP/2 support. *(Optional, with `httpx[http2]`)*Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
line 118why, one step back118* `certifi` - SSL certificates.Add `charset_normalizer` detection. (#1791)Tom Christiebefore adoptionacb5e6a
line 119why, one step back119* `charset_normalizer` - Charset auto-detection.Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
lines 120–122why, one step back120* `rfc3986` - URL parsing & normalization.121 * `idna` - Internationalized domain name support.122* `sniffio` - Async library autodetection.List 'click' and 'rich' in the project dependencies (#1858)Tom Christiebefore adoption7e01677
lines 123–125why, one step back123* `rich` - Rich terminal support. *(Optional, with `httpx[cli]`)*124* `click` - Command line client support. *(Optional, with `httpx[cli]`)*125* `brotli` or `brotlicffi` - Decoding for "brotli" compressed responses. *(Optional, with `httpx[brotli]`)*Tidy up the formatting of HTTP/2 requests (#1860)Tom Christiebefore adoptione1abaf1
line 126why, one step back126* `async_generator` - Backport support for `contextlib.asynccontextmanager`. *(Only required for Python 3.6)*Add progress to streaming download (#1268)cdelerbefore adoptioned16eb3
lines 127–154why, one step back127128A huge amount of credit is due to `requests` for the API layout that129much of this work follows, as well as to `urllib3` for plenty of design130inspiration around the lower-level networking details.131132## Installation133134Install with pip:135136```shell137$ pip install httpx138```139140Or, to include the optional HTTP/2 support, use:141142```shell143$ pip install httpx[http2]144```145146To include the optional brotli decoder support, use:147148```shell149$ pip install httpx[brotli]150```151152HTTPX requires Python 3.6+153154[sync-support]: https://github.com/encode/httpx/issues/572