README.md
This file
Path
README.md
133 lines · 4.7 KiB · Markdown
Last changed by
Fix third party documentation link (#1691)Sidharth Vinodbefore adoption5096663
History of this fileTake it
The walk stopped after 200 commits: lines older than 477824a point at it.
Advanced transport docs (#1165)Tom Christiebefore adoption477824a
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>Advanced transport docs (#1165)Tom Christiebefore adoption477824a
lines 3–18why, 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>1516HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2.1718**Note**: _HTTPX should be considered in beta. We believe we've got the public API toVersion 0.18.0 (#1576)Tom Christiebefore adoption0c2cb24
line 19why, one step back19a stable point now, but would strongly recommend pinning your dependencies to the `0.18.*`Update README to reflect new estimate for v1.0 release (#1445)nkitsainibefore adoption1816393
line 20why, one step back20release, so that you're able to properly review [API changes between package updates](https://github.com/encode/httpx/blob/master/CHANGELOG.md). A 1.0 release is expected to be issued sometime in 2021._Advanced transport docs (#1165)Tom Christiebefore adoption477824a
lines 21–25why, one step back2122---2324Let's get started...25Use pycon for Python console code blocks (#1187)Hugo van Kemenadebefore adoptiond10b7cd
line 26why, one step back26```pyconAdvanced transport docs (#1165)Tom Christiebefore adoption477824a
lines 27–42why, one step back27>>> import httpx28>>> r = httpx.get('https://www.example.org/')29>>> r30<Response [200 OK]>31>>> r.status_code3220033>>> r.headers['content-type']34'text/html; charset=UTF-8'35>>> r.text36'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'37```3839Or, using the async API...4041_Use [IPython](https://ipython.readthedocs.io/en/stable/) or Python 3.8+ with `python -m asyncio` to try this code interactively._42Use pycon for Python console code blocks (#1187)Hugo van Kemenadebefore adoptiond10b7cd
line 43why, one step back43```pyconAdvanced transport docs (#1165)Tom Christiebefore adoption477824a
lines 44–45why, one step back44>>> import httpx45>>> async with httpx.AsyncClient() as client:Fix typo (#1386)Kyungmin Leebefore adoption84dca25
lines 46–47why, one step back46... r = await client.get('https://www.example.org/')47...Advanced transport docs (#1165)Tom Christiebefore adoption477824a
lines 48–61why, one step back48>>> r49<Response [200 OK]>50```5152## Features5354HTTPX builds on the well-established usability of `requests`, and gives you:5556* A broadly [requests-compatible API](https://www.python-httpx.org/compatibility/).57* Standard synchronous interface, but with [async support if you need it](https://www.python-httpx.org/async/).58* HTTP/1.1 [and HTTP/2 support](https://www.python-httpx.org/http2/).59* 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).60* Strict timeouts everywhere.61* Fully type annotated.Update README.md (#1291)Tom Christiebefore adoptionff0febb
line 62why, one step back62* 100% test coverage.Advanced transport docs (#1165)Tom Christiebefore adoption477824a
lines 63–107why, one step back6364Plus all the standard features of `requests`...6566* International Domains and URLs67* Keep-Alive & Connection Pooling68* Sessions with Cookie Persistence69* Browser-style SSL Verification70* Basic/Digest Authentication71* Elegant Key/Value Cookies72* Automatic Decompression73* Automatic Content Decoding74* Unicode Response Bodies75* Multipart File Uploads76* HTTP(S) Proxy Support77* Connection Timeouts78* Streaming Downloads79* .netrc Support80* Chunked Requests8182## Installation8384Install with pip:8586```shell87$ pip install httpx88```8990Or, to include the optional HTTP/2 support, use:9192```shell93$ pip install httpx[http2]94```9596HTTPX requires Python 3.6+.9798## Documentation99100Project documentation is available at [https://www.python-httpx.org/](https://www.python-httpx.org/).101102For a run-through of all the basics, head over to the [QuickStart](https://www.python-httpx.org/quickstart/).103104For 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.105106The [Developer Interface](https://www.python-httpx.org/api/) provides a comprehensive API reference.107Fix third party documentation link (#1691)Sidharth Vinodbefore adoption5096663
line 108why, one step back108To find out about tools that integrate with HTTPX, see [Third Party Packages](https://www.python-httpx.org/third_party_packages/).Advanced transport docs (#1165)Tom Christiebefore adoption477824a
lines 109–122why, one step back109110## Contribute111112If you want to contribute with HTTPX check out the [Contributing Guide](https://www.python-httpx.org/contributing/) to learn how to start.113114## Dependencies115116The HTTPX project relies on these excellent libraries:117118* `httpcore` - The underlying transport implementation for `httpx`.119 * `h11` - HTTP/1.1 support.120 * `h2` - HTTP/2 support. *(Optional)*121* `certifi` - SSL certificates.122* `rfc3986` - URL parsing & normalization.Packaging dependancy tweaks (#1206)Joebefore adoption15c1e42
line 123why, one step back123 * `idna` - Internationalized domain name support.Advanced transport docs (#1165)Tom Christiebefore adoption477824a
line 124why, one step back124* `sniffio` - Async library autodetection.Drop StreamContextManager in favour of `contextlib.contextmanager`/`asynccontextmanager` (#1577)Tom Christiebefore adoption8fd5b71
line 125why, one step back125* `async_generator` - Backport support for `contextlib.asynccontextmanager`. *(Only required for Python 3.6)*Update brotli support to use the brotlicffi package (#1605)Tom Christiebefore adoption760af43
line 126why, one step back126* `brotlicffi` - Decoding for "brotli" compressed responses. *(Optional)*Advanced transport docs (#1165)Tom Christiebefore adoption477824a
lines 127–133why, one step back127128A huge amount of credit is due to `requests` for the API layout that129much of this work follows, as well as to `urllib3` for plenty of design130inspiration around the lower-level networking details.131132<p align="center">— ⭐️ —</p>133<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>