Skip to content
Myr

README.md

This file

Path

README.md

146 lines · 5.1 KiB · Markdown

Last changed by

Add cli support (#1855)Tom Christiebefore adoptionee9250d

History of this file

Take it

The walk stopped after 200 commits: lines older than 8fa8765 point at it.

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

line 1why, one step back
1<p align="center">

Update butterfly logo (#1382)Tom Christiebefore adoptionceccb96

line 2why, one step back
2 <a href="https://www.python-httpx.org/"><img width="350" height="208" src="https://raw.githubusercontent.com/encode/httpx/master/docs/img/butterfly.png" alt='HTTPX'></a>

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

lines 3–15why, one step back
3</p>
45<p align="center"><strong>HTTPX</strong> <em>- A next-generation HTTP client for Python.</em></p>67<p align="center">8<a href="https://github.com/encode/httpx/actions">9 <img src="https://github.com/encode/httpx/workflows/Test%20Suite/badge.svg" alt="Test Suite">10</a>11<a href="https://pypi.org/project/httpx/">12 <img src="https://badge.fury.io/py/httpx.svg" alt="Package version">13</a>14</p>15

Add cli support (#1855)Tom Christiebefore adoptionee9250d

lines 16–18why, one step back
16HTTPX is a fully featured HTTP client library for Python 3. It includes **an integrated
17command line client**, has support for both **HTTP/1.1 and HTTP/2**, and provides both **sync18and async APIs**.

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

line 19why, one step back
19

Add cli support (#1855)Tom Christiebefore adoptionee9250d

line 20why, one step back
20**Note**: *This is the README for the 1.0 pre-release. This release adds support for an integrated command-line client, and also includes a couple of design changes from 0.19. Redirects are no longer followed by default, and the low-level Transport API has been updated. Upgrades from 0.19 will need to see [the CHANGELOG](https://github.com/encode/httpx/blob/version-1.0/CHANGELOG.md) for more details.*

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

lines 21–23why, one step back
21
22---23

Add cli support (#1855)Tom Christiebefore adoptionee9250d

line 24why, one step back
24Installing HTTPX.

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

line 25why, one step back
25

Add cli support (#1855)Tom Christiebefore adoptionee9250d

lines 26–31why, one step back
26```shell
27$ pip install httpx --pre28```2930Now, let's get started...31

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

lines 32–44why, one step back
32```pycon
33>>> import httpx34>>> r = httpx.get('https://www.example.org/')35>>> r36<Response [200 OK]>37>>> r.status_code3820039>>> r.headers['content-type']40'text/html; charset=UTF-8'41>>> r.text42'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'43```44

Add cli support (#1855)Tom Christiebefore adoptionee9250d

line 45why, one step back
45Or, using the command-line client.

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

line 46why, one step back
46

Add cli support (#1855)Tom Christiebefore adoptionee9250d

lines 47–48why, one step back
47```shell
48$ pip install --pre 'httpx[cli]' # The command line client is an optional dependency.

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

lines 49–50why, one step back
49```
50

Add cli support (#1855)Tom Christiebefore adoptionee9250d

lines 51–62why, one step back
51Which now allows us to use HTTPX directly from the command-line...
5253<p align="center">54 <img width="700" src="docs/img/httpx-help.png" alt='httpx --help'>55</p>5657Sending a request...5859<p align="center">60 <img width="700" src="docs/img/httpx-request.png" alt='httpx http://httpbin.org/json'>61</p>62

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

lines 63–67why, one step back
63## Features
6465HTTPX builds on the well-established usability of `requests`, and gives you:6667* A broadly [requests-compatible API](https://www.python-httpx.org/compatibility/).

Add cli support (#1855)Tom Christiebefore adoptionee9250d

line 68why, one step back
68* An integrated command-line client.

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

line 69why, one step back
69* HTTP/1.1 [and HTTP/2 support](https://www.python-httpx.org/http2/).

Add cli support (#1855)Tom Christiebefore adoptionee9250d

line 70why, one step back
70* Standard synchronous interface, but with [async support if you need it](https://www.python-httpx.org/async/).

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

lines 71–73why, one step back
71* Ability to make requests directly to [WSGI applications](https://www.python-httpx.org/advanced/#calling-into-python-web-apps) or [ASGI applications](https://www.python-httpx.org/async/#calling-into-python-web-apps).
72* Strict timeouts everywhere.73* Fully type annotated.

Update README.md (#1291)Tom Christiebefore adoptionff0febb

line 74why, one step back
74* 100% test coverage.

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

lines 75–119why, one step back
75
76Plus 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## Installation9596Install with pip:9798```shell99$ pip install httpx100```101102Or, to include the optional HTTP/2 support, use:103104```shell105$ pip install httpx[http2]106```107108HTTPX requires Python 3.6+.109110## Documentation111112Project documentation is available at [https://www.python-httpx.org/](https://www.python-httpx.org/).113114For a run-through of all the basics, head over to the [QuickStart](https://www.python-httpx.org/quickstart/).115116For more advanced topics, see the [Advanced Usage](https://www.python-httpx.org/advanced/) section, the [async support](https://www.python-httpx.org/async/) section, or the [HTTP/2](https://www.python-httpx.org/http2/) section.117118The [Developer Interface](https://www.python-httpx.org/api/) provides a comprehensive API reference.119

Fix third party documentation link (#1691)Sidharth Vinodbefore adoption5096663

line 120why, one step back
120To find out about tools that integrate with HTTPX, see [Third Party Packages](https://www.python-httpx.org/third_party_packages/).

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

lines 121–133why, one step back
121
122## Contribute123124If you want to contribute with HTTPX check out the [Contributing Guide](https://www.python-httpx.org/contributing/) to learn how to start.125126## Dependencies127128The HTTPX project relies on these excellent libraries:129130* `httpcore` - The underlying transport implementation for `httpx`.131 * `h11` - HTTP/1.1 support.132 * `h2` - HTTP/2 support. *(Optional)*133* `certifi` - SSL certificates.

Add `charset_normalizer` detection. (#1791)Tom Christiebefore adoptionacb5e6a

line 134why, one step back
134* `charset_normalizer` - Charset auto-detection.

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

lines 135–137why, one step back
135* `rfc3986` - URL parsing & normalization.
136 * `idna` - Internationalized domain name support.137* `sniffio` - Async library autodetection.

Drop StreamContextManager in favour of `contextlib.contextmanager`/`asynccontextmanager` (#1577)Tom Christiebefore adoption8fd5b71

line 138why, one step back
138* `async_generator` - Backport support for `contextlib.asynccontextmanager`. *(Only required for Python 3.6)*

Use either brotli or brotlicffi. (#1618)Tom Christiebefore adoptiond514312

line 139why, one step back
139* `brotli` or `brotlicffi` - Decoding for "brotli" compressed responses. *(Optional)*

Drop urllib3 in favor of public gist (#1182)Florimond Mancabefore adoption8fa8765

lines 140–146why, one step back
140
141A huge amount of credit is due to `requests` for the API layout that142much of this work follows, as well as to `urllib3` for plenty of design143inspiration around the lower-level networking details.144145<p align="center">&mdash; ⭐️ &mdash;</p>146<p align="center"><i>HTTPX is <a href="https://github.com/encode/httpx/blob/master/LICENSE.md">BSD licensed</a> code. Designed & built in Brighton, England.</i></p>