index.md
This file
Path
docs/index.md
134 lines · 4.1 KiB · Markdown
Last changed by
Update index.mdTom Christiebefore adoption5cb48d9
History of this fileTake it
The walk stopped after 200 commits: lines older than 45177d2 point at it.
Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
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.Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
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!!! noteAlpha note, and recommendations on pinning versions (#590)Tom Christiebefore adoptionc08ae77
lines 33–35why, one step back33 HTTPX should currently be considered in alpha. We'd love early users and feedback,34 but would strongly recommend pinning your dependencies to the latest median35 release, so that you're able to properly review API changes between packageUpdate index.mdTom Christiebefore adoption5cb48d9
line 36why, one step back36 updates. Currently you should be using `httpx==0.9.*`.Drop sync (#544)Tom Christiebefore adoption206c537
line 37why, one step back37Alpha note, and recommendations on pinning versions (#590)Tom Christiebefore adoptionc08ae77
lines 38–40why, one step back38 In particular, the 0.8 release switched HTTPX into focusing exclusively on39 providing an async client, in order to move the project forward, and help40 us [change our approach to providing sync+async support][sync-support]. IfUpdate index.mdTom Christiebefore adoption81edb1b
line 41why, one step back41 you have been using the sync client, you may want to pin to `httpx==0.7.*`,Alpha note, and recommendations on pinning versions (#590)Tom Christiebefore adoptionc08ae77
lines 42–43why, one step back42 and wait until our sync client is reintroduced.43Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 44–47why, one step back44---4546Let's get started...47Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f
line 48why, one step back48The standard Python REPL does not allow top-level async statements.Drop sync (#544)Tom Christiebefore adoption206c537
line 49why, one step back49Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f
lines 50–51why, one step back50To run these async examples you'll probably want to either use `ipython`,51or use Python 3.8 with `python -m asyncio`.Drop sync (#544)Tom Christiebefore adoption206c537
line 52why, one step back52Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 53–54why, one step back53```python54>>> import httpxDrop sync (#544)Tom Christiebefore adoption206c537
line 55why, one step back55>>> r = await httpx.get('https://www.example.org/')Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 56–59why, one step back56>>> r57<Response [200 OK]>58>>> r.status_code59200Response.protocol -> Response.http_version (#250)Tom Christiebefore adoptionc1ec1c3
line 60why, one step back60>>> r.http_versionForce HTTP/1.1 on short-lived connections (#284)Seth Michael Larsonbefore adoptione7aa6d6
line 61why, one step back61'HTTP/1.1'Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 62–69why, one step back62>>> r.headers['content-type']63'text/html; charset=UTF-8'64>>> r.text65'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'66```6768## Features69Drop sync (#544)Tom Christiebefore adoption206c537
lines 70–71why, one step back70HTTPX is a high performance asynchronous HTTP client, that builds on the71well-established usability of `requests`, and gives you:Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
line 72why, one step back72Drop sync (#544)Tom Christiebefore adoption206c537
line 73why, one step back73* A broadly requests-compatible API.Better HTTP/2 defaults. (#584)Tom Christiebefore adoption30229f1
line 74why, one step back74* HTTP/1.1 and [HTTP/2 support](http2.md).Drop sync (#544)Tom Christiebefore adoption206c537
line 75why, one step back75* Ability to [make requests directly to ASGI applications](advanced.md#calling-into-python-web-apps).Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 76–85why, one step back76* Strict timeouts everywhere.77* Fully type annotated.78* 100% test coverage.7980Plus all the standard features of `requests`...8182* International Domains and URLs83* Keep-Alive & Connection Pooling84* Sessions with Cookie Persistence85* Browser-style SSL VerificationDrop proxies parameter from the high level API (#485)Yeray Diaz Diazbefore adoption09db6ec
line 86why, one step back86* Basic/Digest AuthenticationRely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 87–91why, one step back87* Elegant Key/Value Cookies88* Automatic Decompression89* Automatic Content Decoding90* Unicode Response Bodies91* Multipart File UploadsDrop sync (#544)Tom Christiebefore adoption206c537
line 92why, one step back92* HTTP(S) Proxy SupportRely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 93–94why, one step back93* Connection Timeouts94* Streaming DownloadsDocumented netrc support (#225)Can Sarıgölbefore adoption21939fd
line 95why, one step back95* .netrc SupportRely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 96–101why, one step back96* Chunked Requests9798## Documentation99100For a run-through of all the basics, head over to the [QuickStart](quickstart.md).101Better HTTP/2 defaults. (#584)Tom Christiebefore adoption30229f1
lines 102–103why, one step back102For more advanced topics, see the [Advanced Usage](advanced.md) section,103or the [HTTP/2](http2.md) section.Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 104–114why, one step back104105The [Developer Interface](api.md) provides a comprehensive API reference.106107## Dependencies108109The HTTPX project relies on these excellent libraries:110111* `h2` - HTTP/2 support.112* `h11` - HTTP/1.1 support.113* `certifi` - SSL certificates.114* `chardet` - Fallback auto-detection for response encoding.Merge pull request #315 from cansarigol/hstspreload-docTom Christiebefore adoption67d96b6
line 115why, one step back115* `hstspreload` - determines whether IDNA-encoded host should be only accessed via HTTPS.Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 116–121why, one step back116* `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 designFix typos, spelling issues, and grammar in docs (#426)Kyle Galbraithbefore adoptionb65bce5
line 122why, one step back122inspiration around the lower-level networking details.Rely on IRIReference.encode() for IDNA encoding (#210)Can Sarıgölbefore adoption45177d2
lines 123–132why, one step back123124## 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