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 920925c point at it.

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 1why, one step back
1<p align="center" style="margin: 0 0 10px">

Branding updates for httpx (#130)Tom Christiebefore adoption17bb165

line 2why, one step back
2 <img width="350" height="208" src="https://raw.githubusercontent.com/encode/httpx/master/docs/img/logo.jpg" alt='HTTPX'>

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 3why, one step back
3</p>

Version 0.1Tom Christiebefore adoption920925c

line 4why, one step back
4

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

lines 5–12why, one step back
5<h1 align="center" style="font-size: 3rem; margin: -15px 0">
6HTTPX7</h1>89---1011<div align="center">12<p>

Branding updates for httpx (#130)Tom Christiebefore adoption17bb165

lines 13–14why, one step back
13<a href="https://travis-ci.org/encode/httpx">
14 <img src="https://travis-ci.org/encode/httpx.svg?branch=master" alt="Build Status">

Version 0.1Tom Christiebefore adoption920925c

line 15why, one step back
15</a>

Branding updates for httpx (#130)Tom Christiebefore adoption17bb165

lines 16–17why, one step back
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">

Version 0.1Tom Christiebefore adoption920925c

line 18why, one step back
18</a>

Branding updates for httpx (#130)Tom Christiebefore adoption17bb165

lines 19–20why, one step back
19<a href="https://pypi.org/project/httpx/">
20 <img src="https://badge.fury.io/py/httpx.svg" alt="Package version">

Version 0.1Tom Christiebefore adoption920925c

line 21why, one step back
21</a>

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 22why, one step back
22</p>

Version 0.1Tom Christiebefore adoption920925c

line 23why, one step back
23

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

lines 24–25why, one step back
24<em>A next-generation HTTP client for Python.</em>
25</div>

Version 0.1Tom Christiebefore adoption920925c

line 26why, one step back
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.

Version 0.1Tom Christiebefore adoption920925c

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

Version 0.1Tom Christiebefore adoption920925c

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

Version 0.1Tom Christiebefore adoption920925c

line 46why, one step back
46```python

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 47why, one step back
47>>> import httpx

Drop sync (#544)Tom Christiebefore adoption206c537

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

Int status codes (#92)Tom Christiebefore adoption56a7943

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

Version 0.1Tom Christiebefore adoption920925c

line 51why, one step back
51>>> r.status_code

Int status codes (#92)Tom Christiebefore adoption56a7943

line 52why, one step back
52200

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'

Version 0.1Tom Christiebefore adoption920925c

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:

Version 0.1Tom Christiebefore adoption920925c

line 65why, one step back
65

Drop sync (#544)Tom Christiebefore adoption206c537

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

Version 0.1Tom Christiebefore adoption920925c

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).

Version 0.1Tom Christiebefore adoption920925c

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

Version 0.1Tom Christiebefore adoption920925c

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

Version 0.1Tom Christiebefore adoption920925c

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

Version 0.1Tom Christiebefore adoption920925c

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.

Version 0.1Tom Christiebefore adoption920925c

lines 96–100why, one step back
96
97The [Developer Interface](api.md) provides a comprehensive API reference.9899## Dependencies100

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 101why, one step back
101The HTTPX project relies on these excellent libraries:

Version 0.1Tom Christiebefore adoption920925c

lines 102–106why, one step back
102
103* `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.

Version 0.1Tom Christiebefore adoption920925c

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.

Version 0.1Tom Christiebefore adoption920925c

lines 115–120why, one step back
115
116## Installation117118Install with pip:119120```shell

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 121why, one step back
121$ pip install httpx

Version 0.1Tom Christiebefore adoption920925c

lines 122–123why, one step back
122```
123

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 124why, one step back
124HTTPX requires Python 3.6+