index.md
This file
Path
docs/index.md
150 lines · 4.1 KiB · Markdown
Last changed by
Removed leading $ from cli code blocks (#3174)Shinybefore adoptionfa6dac8
History of this fileTake it
The walk stopped after 200 commits: lines older than 4cbf13e point at it.
Raise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 1–30why, 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/butterfly.png" 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.2526---2728Install HTTPX using pip:2930```shellRemoved leading $ from cli code blocks (#3174)Shinybefore adoptionfa6dac8
line 31why, one step back31pip install httpxRaise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 32–52why, one step back32```3334Now, let's get started:3536```pycon37>>> import httpx38>>> r = httpx.get('https://www.example.org/')39>>> r40<Response [200 OK]>41>>> r.status_code4220043>>> r.headers['content-type']44'text/html; charset=UTF-8'45>>> r.text46'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'47```4849Or, using the command-line client.5051```shell52# The command line client is an optional dependency.Removed leading $ from cli code blocks (#3174)Shinybefore adoptionfa6dac8
line 53why, one step back53pip install 'httpx[cli]'Raise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 54–70why, one step back54```5556Which now allows us to use HTTPX directly from the command-line...57585960Sending a request...61626364## Features6566HTTPX builds on the well-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).Fix doc links for making requests directly to WSGI/ASGI apps (#3186)Kien Dangbefore adoptionbe56b74
line 71why, one step back71* Ability to make requests directly to [WSGI applications](advanced/transports.md#wsgi-transport) or [ASGI applications](advanced/transports.md#asgi-transport).Raise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 72–97why, one step back72* Strict timeouts everywhere.73* Fully type annotated.74* 100% test coverage.7576Plus 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).97Fix sections references (#3058)Kar Petrosyanbefore adoption73e6888
line 98why, one step back98For more advanced topics, see the **Advanced** section,Raise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 99–111why, one step back99the [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.111* `certifi` - SSL certificates.Drop `rfc3986` requirement. (#2252)Tom Christiebefore adoption57daabf
line 112why, one step back112* `idna` - Internationalized domain name support.Raise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 113–121why, one step back113* `sniffio` - Async library autodetection.114115As well as these optional installs:116117* `h2` - HTTP/2 support. *(Optional, with `httpx[http2]`)*118* `socksio` - SOCKS proxy support. *(Optional, with `httpx[socks]`)*119* `rich` - Rich terminal support. *(Optional, with `httpx[cli]`)*120* `click` - Command line client support. *(Optional, with `httpx[cli]`)*121* `brotli` or `brotlicffi` - Decoding for "brotli" compressed responses. *(Optional, with `httpx[brotli]`)*Add support for zstd decoding (#3139)Michiel W. Beijenbefore adoption392dbe4
line 122why, one step back122* `zstandard` - Decoding for "zstd" compressed responses. *(Optional, with `httpx[zstd]`)*Raise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 123–132why, one step back123124A huge amount of credit is due to `requests` for the API layout that125much of this work follows, as well as to `urllib3` for plenty of design126inspiration around the lower-level networking details.127128## Installation129130Install with pip:131132```shellRemoved leading $ from cli code blocks (#3174)Shinybefore adoptionfa6dac8
line 133why, one step back133pip install httpxRaise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 134–138why, one step back134```135136Or, to include the optional HTTP/2 support, use:137138```shellRemoved leading $ from cli code blocks (#3174)Shinybefore adoptionfa6dac8
line 139why, one step back139pip install httpx[http2]Raise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 140–141why, one step back140```141Add support for zstd decoding (#3139)Michiel W. Beijenbefore adoption392dbe4
line 142why, one step back142To include the optional brotli and zstandard decoders support, use:Raise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 143–144why, one step back143144```shellRemoved leading $ from cli code blocks (#3174)Shinybefore adoptionfa6dac8
line 145why, one step back145pip install httpx[brotli,zstd]Raise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 146–147why, one step back146```147Drop support for Python 3.7 (#2813)Iurii Plinerbefore adoptionb40c04d
line 148why, one step back148HTTPX requires Python 3.8+Raise `TypeError` on invalid query params. (#2523)Tom Christiebefore adoption4cbf13e
lines 149–150why, one step back149150[sync-support]: https://github.com/encode/httpx/issues/572