README.md
This file
Path
README.md
128 lines · 4.6 KiB · Markdown
Last changed by
Add an async example to intro snippets (#750)Florimond Mancabefore adoption7d84408
History of this fileTake it
The walk stopped after 200 commits: lines older than 640667d point at it.
Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
line 1why, one step back1<p align="center">Use www.python-httpx.org domainTom Christiebefore adoption367bff6
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/logo.jpg" alt='HTTPX'></a>Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
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://travis-ci.org/encode/httpx">9 <img src="https://travis-ci.org/encode/httpx.svg?branch=master" alt="Build Status">10</a>11<a href="https://codecov.io/gh/encode/httpx">12 <img src="https://codecov.io/gh/encode/httpx/branch/master/graph/badge.svg" alt="Coverage">13</a>14<a href="https://pypi.org/project/httpx/">15 <img src="https://badge.fury.io/py/httpx.svg" alt="Package version">16</a>17</p>18Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 19why, one step back19HTTPX 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.Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
line 20why, one step back20Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
lines 21–22why, one step back21**Note**: _HTTPX should be considered in beta. We believe we've got the public API to22a stable point now, but would strongly recommend pinning your dependencies to the `0.11.*`Link to changelogTom Christiebefore adoption97807bf
line 23why, one step back23release, 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 on or before April 2020._Drop sync (#544)Tom Christiebefore adoption206c537
line 24why, one step back24Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 25–30why, one step back25---2627Let's get started...2829```python30>>> import httpxProposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 31why, one step back31>>> r = httpx.get('https://www.example.org/')Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 32–41why, one step back32>>> r33<Response [200 OK]>34>>> r.status_code3520036>>> r.headers['content-type']37'text/html; charset=UTF-8'38>>> r.text39'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'40```41Add an async example to intro snippets (#750)Florimond Mancabefore adoption7d84408
lines 42–53why, one step back42Or, using the async API...4344_Use [IPython](https://ipython.readthedocs.io/en/stable/) or Python 3.8+ with `python -m asyncio` to try this code interactively._4546```python47>>> import httpx48>>> async with httpx.AsyncClient() as client:49>>> r = await client.get('https://www.example.org/')50>>> r51<Response [200 OK]>52```53Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 54–57why, one step back54## Features5556HTTPX builds on the well-established usability of `requests`, and gives you:57Use www.python-httpx.org domainTom Christiebefore adoptionb932d94
lines 58–61why, one step back58* A broadly [requests-compatible API](https://www.python-httpx.org/compatibility/).59* Standard synchronous interface, but with [async support if you need it](https://www.python-httpx.org/async/).60* HTTP/1.1 [and HTTP/2 support](https://www.python-httpx.org/http2/).61* 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).Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 62–63why, one step back62* Strict timeouts everywhere.63* Fully type annotated.Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 64why, one step back64* 99% test coverage.Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 65–77why, one step back6566Plus all the standard features of `requests`...6768* International Domains and URLs69* Keep-Alive & Connection Pooling70* Sessions with Cookie Persistence71* Browser-style SSL Verification72* Basic/Digest Authentication73* Elegant Key/Value Cookies74* Automatic Decompression75* Automatic Content Decoding76* Unicode Response Bodies77* Multipart File UploadsDrop sync (#544)Tom Christiebefore adoption206c537
line 78why, one step back78* HTTP(S) Proxy SupportRelease 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 79–95why, one step back79* Connection Timeouts80* Streaming Downloads81* .netrc Support82* Chunked Requests8384## Installation8586Install with pip:8788```shell89$ pip install httpx90```9192httpx requires Python 3.6+9394## Documentation95Use www.python-httpx.org domainTom Christiebefore adoptionb932d94
line 96why, one step back96Project documentation is available at [https://www.python-httpx.org/](https://www.python-httpx.org/).Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
line 97why, one step back97Use www.python-httpx.org domainTom Christiebefore adoptionb932d94
line 98why, one step back98For a run-through of all the basics, head over to the [QuickStart](https://www.python-httpx.org/quickstart/).Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
line 99why, one step back99Use www.python-httpx.org domainTom Christiebefore adoptionb932d94
line 100why, one step back100For 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.Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
line 101why, one step back101Use www.python-httpx.org domainTom Christiebefore adoptionb932d94
line 102why, one step back102The [Developer Interface](https://www.python-httpx.org/api/) provides a comprehensive API reference.Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 103–105why, one step back103104## Contribute105Use www.python-httpx.org domainTom Christiebefore adoptionb932d94
line 106why, one step back106If you want to contribute with HTTPX check out the [Contributing Guide](https://www.python-httpx.org/contributing/) to learn how to start.Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 107–111why, one step back107108## Dependencies109110The httpx project relies on these excellent libraries:111Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 112why, one step back112* `urllib3` - Sync client support.Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
line 113why, one step back113* `h11` - HTTP/1.1 support.Proposed 0.11 docs (#727)Tom Christiebefore adoption2038919
line 114why, one step back114* `h2` - HTTP/2 support.Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 115–119why, one step back115* `certifi` - SSL certificates.116* `chardet` - Fallback auto-detection for response encoding.117* `hstspreload` - determines whether IDNA-encoded host should be only accessed via HTTPS.118* `idna` - Internationalized domain name support.119* `rfc3986` - URL parsing & normalization.Concurrency autodetection (#585)Tom Christiebefore adoption3cbe731
line 120why, one step back120* `sniffio` - Async library autodetection.Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 121–124why, one step back121* `brotlipy` - Decoding for "brotli" compressed responses. *(Optional)*122123A huge amount of credit is due to `requests` for the API layout that124much of this work follows, as well as to `urllib3` for plenty of designFix typos, spelling issues, and grammar in docs (#426)Kyle Galbraithbefore adoptionb65bce5
line 125why, one step back125inspiration around the lower-level networking details.Release 0.7.4 (#388)Florimond Mancabefore adoption640667d
lines 126–128why, one step back126127<p align="center">— ⭐️ —</p>128<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>