index.md
This file
Path
docs/index.md
124 lines · 3.5 KiB · Markdown
Last changed by
Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f
History of this fileTake it
The walk stopped after 200 commits: lines older than fb17459 point at it.
Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
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>26Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f
line 27why, one step back27HTTPX is an asynchronous client library that supports HTTP/1.1 and HTTP/2.Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
line 28why, one step back28Drop sync (#544)Tom Christiebefore adoption206c537
line 29why, one step back29It can be used in high-performance async web frameworks, using either asyncioClient handles redirect + auth (#552)Tom Christiebefore adoption00e150f
line 30why, one step back30or trio, and is able to support making large numbers of concurrent requests.Drop sync (#544)Tom Christiebefore adoption206c537
lines 31–32why, one step back3132!!! noteClient handles redirect + auth (#552)Tom Christiebefore adoption00e150f
line 33why, one step back33 The 0.8 release switched HTTPX into focusing exclusively on providing an asyncDrop sync (#544)Tom Christiebefore adoption206c537
lines 34–36why, one step back34 client. It is possible that we'll look at re-introducing a sync API at a35 later date.36Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 37–40why, one step back37---3839Let's get started...40Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f
line 41why, one step back41The standard Python REPL does not allow top-level async statements.Drop sync (#544)Tom Christiebefore adoption206c537
line 42why, one step back42Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f
lines 43–44why, one step back43To run these async examples you'll probably want to either use `ipython`,44or use Python 3.8 with `python -m asyncio`.Drop sync (#544)Tom Christiebefore adoption206c537
line 45why, one step back45Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 46–47why, one step back46```python47>>> import httpxDrop sync (#544)Tom Christiebefore adoption206c537
line 48why, one step back48>>> r = await httpx.get('https://www.example.org/')Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 49–52why, one step back49>>> r50<Response [200 OK]>51>>> r.status_code52200Response.protocol -> Response.http_version (#250)Tom Christiebefore adoptionc1ec1c3
line 53why, one step back53>>> r.http_versionForce HTTP/1.1 on short-lived connections (#284)Seth Michael Larsonbefore adoptione7aa6d6
line 54why, one step back54'HTTP/1.1'Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 55–62why, one step back55>>> r.headers['content-type']56'text/html; charset=UTF-8'57>>> r.text58'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'59```6061## Features62Drop sync (#544)Tom Christiebefore adoption206c537
lines 63–64why, one step back63HTTPX is a high performance asynchronous HTTP client, that builds on the64well-established usability of `requests`, and gives you:Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
line 65why, one step back65Drop sync (#544)Tom Christiebefore adoption206c537
line 66why, one step back66* A broadly requests-compatible API.Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
line 67why, one step back67* HTTP/2 and HTTP/1.1 support.Drop sync (#544)Tom Christiebefore adoption206c537
line 68why, one step back68* Ability to [make requests directly to ASGI applications](advanced.md#calling-into-python-web-apps).Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 69–78why, one step back69* Strict timeouts everywhere.70* Fully type annotated.71* 100% test coverage.7273Plus all the standard features of `requests`...7475* International Domains and URLs76* Keep-Alive & Connection Pooling77* Sessions with Cookie Persistence78* Browser-style SSL VerificationDrop proxies parameter from the high level API (#485)Yeray Diaz Diazbefore adoption09db6ec
line 79why, one step back79* Basic/Digest AuthenticationFixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 80–84why, one step back80* Elegant Key/Value Cookies81* Automatic Decompression82* Automatic Content Decoding83* Unicode Response Bodies84* Multipart File UploadsDrop sync (#544)Tom Christiebefore adoption206c537
line 85why, one step back85* HTTP(S) Proxy SupportFixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 86–87why, one step back86* Connection Timeouts87* Streaming DownloadsDocumented netrc support (#225)Can Sarıgölbefore adoption21939fd
line 88why, one step back88* .netrc SupportFixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 89–94why, one step back89* Chunked Requests9091## Documentation9293For a run-through of all the basics, head over to the [QuickStart](quickstart.md).94Drop sync (#544)Tom Christiebefore adoption206c537
line 95why, one step back95For more advanced topics, see the [Advanced Usage](advanced.md) section.Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 96–106why, one step back9697The [Developer Interface](api.md) provides a comprehensive API reference.9899## Dependencies100101The HTTPX project relies on these excellent libraries:102103* `h2` - HTTP/2 support.104* `h11` - HTTP/1.1 support.105* `certifi` - SSL certificates.106* `chardet` - Fallback auto-detection for response encoding.Merge pull request #315 from cansarigol/hstspreload-docTom Christiebefore adoption67d96b6
line 107why, one step back107* `hstspreload` - determines whether IDNA-encoded host should be only accessed via HTTPS.Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 108–113why, one step back108* `idna` - Internationalized domain name support.109* `rfc3986` - URL parsing & normalization.110* `brotlipy` - Decoding for "brotli" compressed responses. *(Optional)*111112A huge amount of credit is due to `requests` for the API layout that113much of this work follows, as well as to `urllib3` for plenty of designFix typos, spelling issues, and grammar in docs (#426)Kyle Galbraithbefore adoptionb65bce5
line 114why, one step back114inspiration around the lower-level networking details.Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459
lines 115–124why, one step back115116## Installation117118Install with pip:119120```shell121$ pip install httpx122```123124HTTPX requires Python 3.6+