Skip to content
Myr

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 file

Take 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 back
1<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>26

Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f

line 27why, one step back
27HTTPX 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 back
28

Drop sync (#544)Tom Christiebefore adoption206c537

line 29why, one step back
29It can be used in high-performance async web frameworks, using either asyncio

Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f

line 30why, one step back
30or trio, and is able to support making large numbers of concurrent requests.

Drop sync (#544)Tom Christiebefore adoption206c537

lines 31–32why, one step back
31
32!!! note

Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f

line 33why, one step back
33 The 0.8 release switched HTTPX into focusing exclusively on providing an async

Drop sync (#544)Tom Christiebefore adoption206c537

lines 34–36why, one step back
34 client. It is possible that we'll look at re-introducing a sync API at a
35 later date.36

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

lines 37–40why, one step back
37---
3839Let's get started...40

Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f

line 41why, one step back
41The standard Python REPL does not allow top-level async statements.

Drop sync (#544)Tom Christiebefore adoption206c537

line 42why, one step back
42

Client handles redirect + auth (#552)Tom Christiebefore adoption00e150f

lines 43–44why, one step back
43To 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 back
45

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

lines 46–47why, one step back
46```python
47>>> import httpx

Drop sync (#544)Tom Christiebefore adoption206c537

line 48why, one step back
48>>> r = await httpx.get('https://www.example.org/')

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

lines 49–52why, one step back
49>>> r
50<Response [200 OK]>51>>> r.status_code52200

Response.protocol -> Response.http_version (#250)Tom Christiebefore adoptionc1ec1c3

line 53why, one step back
53>>> r.http_version

Force HTTP/1.1 on short-lived connections (#284)Seth Michael Larsonbefore adoptione7aa6d6

line 54why, one step back
54'HTTP/1.1'

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

lines 55–62why, one step back
55>>> 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## Features62

Drop sync (#544)Tom Christiebefore adoption206c537

lines 63–64why, one step back
63HTTPX is a high performance asynchronous HTTP client, that builds on the
64well-established usability of `requests`, and gives you:

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

line 65why, one step back
65

Drop sync (#544)Tom Christiebefore adoption206c537

line 66why, one step back
66* A broadly requests-compatible API.

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

line 67why, one step back
67* HTTP/2 and HTTP/1.1 support.

Drop sync (#544)Tom Christiebefore adoption206c537

line 68why, one step back
68* 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 back
69* 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 Verification

Drop proxies parameter from the high level API (#485)Yeray Diaz Diazbefore adoption09db6ec

line 79why, one step back
79* Basic/Digest Authentication

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

lines 80–84why, one step back
80* Elegant Key/Value Cookies
81* Automatic Decompression82* Automatic Content Decoding83* Unicode Response Bodies84* Multipart File Uploads

Drop sync (#544)Tom Christiebefore adoption206c537

line 85why, one step back
85* HTTP(S) Proxy Support

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

lines 86–87why, one step back
86* Connection Timeouts
87* Streaming Downloads

Documented netrc support (#225)Can Sarıgölbefore adoption21939fd

line 88why, one step back
88* .netrc Support

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

lines 89–94why, one step back
89* Chunked Requests
9091## Documentation9293For a run-through of all the basics, head over to the [QuickStart](quickstart.md).94

Drop sync (#544)Tom Christiebefore adoption206c537

line 95why, one step back
95For more advanced topics, see the [Advanced Usage](advanced.md) section.

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

lines 96–106why, one step back
96
97The [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 back
107* `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 back
108* `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 design

Fix typos, spelling issues, and grammar in docs (#426)Kyle Galbraithbefore adoptionb65bce5

line 114why, one step back
114inspiration around the lower-level networking details.

Fixed multipart header params encoding (#167)Nikbefore adoptionfb17459

lines 115–124why, one step back
115
116## Installation117118Install with pip:119120```shell121$ pip install httpx122```123124HTTPX requires Python 3.6+