Skip to content
Myr

README.md

This file

Path

README.md

150 lines · 4.8 KiB · Markdown

Last changed by

Drop EOL Python 3.6 (#2097)Ofek Levbefore adoption67c2970

History of this file

Take it

The walk stopped after 200 commits: lines older than 666cbbd point at it.

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

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>

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

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

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

lines 19–21why, one step back
19
20---21

Version 0.20 (#1890)Tom Christiebefore adoption35164b7

line 22why, one step back
22Install HTTPX using pip:

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

line 23why, one step back
23

Add cli support (#1855)Tom Christiebefore adoptionee9250d

line 24why, one step back
24```shell

Version 0.20 (#1890)Tom Christiebefore adoption35164b7

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

Add cli support (#1855)Tom Christiebefore adoptionee9250d

lines 26–27why, one step back
26```
27

Version 0.20 (#1890)Tom Christiebefore adoption35164b7

line 28why, one step back
28Now, let's get started:

Add cli support (#1855)Tom Christiebefore adoptionee9250d

line 29why, one step back
29

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

lines 30–42why, one step back
30```pycon
31>>> import httpx32>>> r = httpx.get('https://www.example.org/')33>>> r34<Response [200 OK]>35>>> r.status_code3620037>>> r.headers['content-type']38'text/html; charset=UTF-8'39>>> r.text40'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'41```42

Add cli support (#1855)Tom Christiebefore adoptionee9250d

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

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

line 44why, one step back
44

Add cli support (#1855)Tom Christiebefore adoptionee9250d

line 45why, one step back
45```shell

Version 0.20 (#1890)Tom Christiebefore adoption35164b7

line 46why, one step back
46$ pip install 'httpx[cli]' # The command line client is an optional dependency.

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

lines 47–48why, one step back
47```
48

Add cli support (#1855)Tom Christiebefore adoptionee9250d

lines 49–60why, one step back
49Which now allows us to use HTTPX directly from the command-line...
5051<p align="center">52 <img width="700" src="docs/img/httpx-help.png" alt='httpx --help'>53</p>5455Sending a request...5657<p align="center">58 <img width="700" src="docs/img/httpx-request.png" alt='httpx http://httpbin.org/json'>59</p>60

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

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

Add cli support (#1855)Tom Christiebefore adoptionee9250d

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

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

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

Add cli support (#1855)Tom Christiebefore adoptionee9250d

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

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

lines 69–117why, one step back
69* 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).
70* Strict timeouts everywhere.71* Fully type annotated.72* 100% test coverage.7374Plus all the standard features of `requests`...7576* International Domains and URLs77* Keep-Alive & Connection Pooling78* Sessions with Cookie Persistence79* Browser-style SSL Verification80* Basic/Digest Authentication81* Elegant Key/Value Cookies82* Automatic Decompression83* Automatic Content Decoding84* Unicode Response Bodies85* Multipart File Uploads86* HTTP(S) Proxy Support87* Connection Timeouts88* Streaming Downloads89* .netrc Support90* Chunked Requests9192## Installation9394Install with pip:9596```shell97$ pip install httpx98```99100Or, to include the optional HTTP/2 support, use:101102```shell103$ pip install httpx[http2]104```105106HTTPX requires Python 3.6+.107108## Documentation109110Project documentation is available at [https://www.python-httpx.org/](https://www.python-httpx.org/).111112For a run-through of all the basics, head over to the [QuickStart](https://www.python-httpx.org/quickstart/).113114For 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.115116The [Developer Interface](https://www.python-httpx.org/api/) provides a comprehensive API reference.117

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

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

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

lines 119–130why, one step back
119
120## Contribute121122If you want to contribute with HTTPX check out the [Contributing Guide](https://www.python-httpx.org/contributing/) to learn how to start.123124## Dependencies125126The HTTPX project relies on these excellent libraries:127128* `httpcore` - The underlying transport implementation for `httpx`.129 * `h11` - HTTP/1.1 support.130* `certifi` - SSL certificates.

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

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

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

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

SOCKS proxy support (#2034)Tom Christiebefore adoption8dc9b6b

lines 135–139why, one step back
135
136As well as these optional installs:137138* `h2` - HTTP/2 support. *(Optional, with `httpx[http2]`)*139* `socksio` - SOCKS proxy support. *(Optional, with `httpx[socks]`)*

List 'click' and 'rich' in the project dependencies (#1858)Tom Christiebefore adoption7e01677

lines 140–142why, one step back
140* `rich` - Rich terminal support. *(Optional, with `httpx[cli]`)*
141* `click` - Command line client support. *(Optional, with `httpx[cli]`)*142* `brotli` or `brotlicffi` - Decoding for "brotli" compressed responses. *(Optional, with `httpx[brotli]`)*

Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd

lines 143–147why, one step back
143
144A huge amount of credit is due to `requests` for the API layout that145much of this work follows, as well as to `urllib3` for plenty of design146inspiration around the lower-level networking details.147

Docs tweaks (#2075)Tom Christiebefore adoption2072aa2

lines 148–150why, one step back
148---
149150<p align="center"><i>HTTPX is <a href="https://github.com/encode/httpx/blob/master/LICENSE.md">BSD licensed</a> code.<br/>Designed & crafted with care.</i><br/>&mdash; 🦋 &mdash;</p>