README.md
This file
Path
README.md
148 lines · 5.3 KiB · Markdown
Last changed by
Version 0.21 release notes (#1938)Tom Christiebefore adoptionb4f6069
History of this fileTake 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 back1<p align="center">Update butterfly logo (#1382)Tom Christiebefore adoptionceccb96
line 2why, one step back2 <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 back3</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>15Add cli support (#1855)Tom Christiebefore adoptionee9250d
lines 16–18why, one step back16HTTPX is a fully featured HTTP client library for Python 3. It includes **an integrated17command 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
line 19why, one step back19Version 0.21 release notes (#1938)Tom Christiebefore adoptionb4f6069
line 20why, one step back20**Note**: *The 0.21 release includes some improvements to the integrated command-line client. This latest version integrates against a re-designed version of `httpcore`. Both packages ought to automatically update to the required versions, but if you are seeing any issues then you should ensure that you have `httpx==0.21.*` and `httpcore==0.14.*` installed. See [the CHANGELOG](https://github.com/encode/httpx/blob/master/CHANGELOG.md) for more details.*Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd
lines 21–23why, one step back2122---23Version 0.20 (#1890)Tom Christiebefore adoption35164b7
line 24why, one step back24Install HTTPX using pip:Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd
line 25why, one step back25Add cli support (#1855)Tom Christiebefore adoptionee9250d
line 26why, one step back26```shellVersion 0.20 (#1890)Tom Christiebefore adoption35164b7
line 27why, one step back27$ pip install httpxAdd cli support (#1855)Tom Christiebefore adoptionee9250d
lines 28–29why, one step back28```29Version 0.20 (#1890)Tom Christiebefore adoption35164b7
line 30why, one step back30Now, let's get started:Add cli support (#1855)Tom Christiebefore adoptionee9250d
line 31why, one step back31Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd
lines 32–44why, one step back32```pycon33>>> 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```44Add cli support (#1855)Tom Christiebefore adoptionee9250d
line 45why, one step back45Or, using the command-line client.Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd
line 46why, one step back46Add cli support (#1855)Tom Christiebefore adoptionee9250d
line 47why, one step back47```shellVersion 0.20 (#1890)Tom Christiebefore adoption35164b7
line 48why, one step back48$ 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 49–50why, one step back49```50Add cli support (#1855)Tom Christiebefore adoptionee9250d
lines 51–62why, one step back51Which 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>62Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd
lines 63–67why, one step back63## Features6465HTTPX 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 back68* An integrated command-line client.Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd
line 69why, one step back69* HTTP/1.1 [and HTTP/2 support](https://www.python-httpx.org/http2/).Add cli support (#1855)Tom Christiebefore adoptionee9250d
line 70why, one step back70* 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 71–119why, one step back71* 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.74* 100% test coverage.7576Plus 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.119Fix third party documentation link (#1691)Sidharth Vinodbefore adoption5096663
line 120why, one step back120To 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 121–131why, one step back121122## 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.List 'click' and 'rich' in the project dependencies (#1858)Tom Christiebefore adoption7e01677
line 132why, one step back132 * `h2` - HTTP/2 support. *(Optional, with `httpx[http2]`)*Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd
line 133why, one step back133* `certifi` - SSL certificates.Add `charset_normalizer` detection. (#1791)Tom Christiebefore adoptionacb5e6a
line 134why, one step back134* `charset_normalizer` - Charset auto-detection.Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd
lines 135–137why, one step back135* `rfc3986` - URL parsing & normalization.136 * `idna` - Internationalized domain name support.137* `sniffio` - Async library autodetection.List 'click' and 'rich' in the project dependencies (#1858)Tom Christiebefore adoption7e01677
lines 138–140why, one step back138* `rich` - Rich terminal support. *(Optional, with `httpx[cli]`)*139* `click` - Command line client support. *(Optional, with `httpx[cli]`)*140* `brotli` or `brotlicffi` - Decoding for "brotli" compressed responses. *(Optional, with `httpx[brotli]`)*Tidy up the formatting of HTTP/2 requests (#1860)Tom Christiebefore adoptione1abaf1
line 141why, one step back141* `async_generator` - Backport support for `contextlib.asynccontextmanager`. *(Only required for Python 3.6)*Fix automatic .read() when Response instances are created with content=<str> (#1324)Tom Christiebefore adoption666cbbd
lines 142–148why, one step back142143A huge amount of credit is due to `requests` for the API layout that144much of this work follows, as well as to `urllib3` for plenty of design145inspiration around the lower-level networking details.146147<p align="center">— ⭐️ —</p>148<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>