Skip to content
Myr

README.md

This file

Path

README.md

147 lines · 4.8 KiB · Markdown

Last changed by

Handle empty zstd responses (#3412)Tom Christiebefore adoption47f4a96

History of this file

Take it

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

Ensure all WSGITransport environs have a SERVER_PROTOCOL (#2708)Peter Lazorchakbefore adoptionabb994c

lines 1–15why, one step back
1<p align="center">
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>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

Handle empty zstd responses (#3412)Tom Christiebefore adoption47f4a96

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

Ensure all WSGITransport environs have a SERVER_PROTOCOL (#2708)Peter Lazorchakbefore adoptionabb994c

lines 17–22why, one step back
17
18---1920Install HTTPX using pip:2122```shell

Revert "Removed leading $ from cli code blocks" (#3192)Tom Christiebefore adoptionf06171f

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

Ensure all WSGITransport environs have a SERVER_PROTOCOL (#2708)Peter Lazorchakbefore adoptionabb994c

lines 24–43why, one step back
24```
2526Now, let's get started:2728```pycon29>>> import httpx30>>> r = httpx.get('https://www.example.org/')31>>> r32<Response [200 OK]>33>>> r.status_code3420035>>> r.headers['content-type']36'text/html; charset=UTF-8'37>>> r.text38'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'39```4041Or, using the command-line client.4243```shell

Revert "Removed leading $ from cli code blocks" (#3192)Tom Christiebefore adoptionf06171f

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

Ensure all WSGITransport environs have a SERVER_PROTOCOL (#2708)Peter Lazorchakbefore adoptionabb994c

lines 45–66why, one step back
45```
4647Which now allows us to use HTTPX directly from the command-line...4849<p align="center">50 <img width="700" src="docs/img/httpx-help.png" alt='httpx --help'>51</p>5253Sending a request...5455<p align="center">56 <img width="700" src="docs/img/httpx-request.png" alt='httpx http://httpbin.org/json'>57</p>5859## Features6061HTTPX builds on the well-established usability of `requests`, and gives you:6263* A broadly [requests-compatible API](https://www.python-httpx.org/compatibility/).64* An integrated command-line client.65* HTTP/1.1 [and HTTP/2 support](https://www.python-httpx.org/http2/).66* Standard synchronous interface, but with [async support if you need it](https://www.python-httpx.org/async/).

Fix doc links for making requests directly to WSGI/ASGI apps (#3186)Kien Dangbefore adoptionbe56b74

line 67why, one step back
67* Ability to make requests directly to [WSGI applications](https://www.python-httpx.org/advanced/transports/#wsgi-transport) or [ASGI applications](https://www.python-httpx.org/advanced/transports/#asgi-transport).

Ensure all WSGITransport environs have a SERVER_PROTOCOL (#2708)Peter Lazorchakbefore adoptionabb994c

lines 68–94why, one step back
68* Strict timeouts everywhere.
69* Fully type annotated.70* 100% test coverage.7172Plus all the standard features of `requests`...7374* International Domains and URLs75* Keep-Alive & Connection Pooling76* Sessions with Cookie Persistence77* Browser-style SSL Verification78* Basic/Digest Authentication79* Elegant Key/Value Cookies80* Automatic Decompression81* Automatic Content Decoding82* Unicode Response Bodies83* Multipart File Uploads84* HTTP(S) Proxy Support85* Connection Timeouts86* Streaming Downloads87* .netrc Support88* Chunked Requests8990## Installation9192Install with pip:9394```shell

Revert "Removed leading $ from cli code blocks" (#3192)Tom Christiebefore adoptionf06171f

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

Ensure all WSGITransport environs have a SERVER_PROTOCOL (#2708)Peter Lazorchakbefore adoptionabb994c

lines 96–100why, one step back
96```
9798Or, to include the optional HTTP/2 support, use:99100```shell

Revert "Removed leading $ from cli code blocks" (#3192)Tom Christiebefore adoptionf06171f

line 101why, one step back
101$ pip install httpx[http2]

Ensure all WSGITransport environs have a SERVER_PROTOCOL (#2708)Peter Lazorchakbefore adoptionabb994c

lines 102–103why, one step back
102```
103

Drop support for Python 3.7 (#2813)Iurii Plinerbefore adoptionb40c04d

line 104why, one step back
104HTTPX requires Python 3.8+.

Ensure all WSGITransport environs have a SERVER_PROTOCOL (#2708)Peter Lazorchakbefore adoptionabb994c

lines 105–138why, one step back
105
106## Documentation107108Project documentation is available at [https://www.python-httpx.org/](https://www.python-httpx.org/).109110For a run-through of all the basics, head over to the [QuickStart](https://www.python-httpx.org/quickstart/).111112For 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.113114The [Developer Interface](https://www.python-httpx.org/api/) provides a comprehensive API reference.115116To find out about tools that integrate with HTTPX, see [Third Party Packages](https://www.python-httpx.org/third_party_packages/).117118## Contribute119120If you want to contribute with HTTPX check out the [Contributing Guide](https://www.python-httpx.org/contributing/) to learn how to start.121122## Dependencies123124The HTTPX project relies on these excellent libraries:125126* `httpcore` - The underlying transport implementation for `httpx`.127 * `h11` - HTTP/1.1 support.128* `certifi` - SSL certificates.129* `idna` - Internationalized domain name support.130* `sniffio` - Async library autodetection.131132As well as these optional installs:133134* `h2` - HTTP/2 support. *(Optional, with `httpx[http2]`)*135* `socksio` - SOCKS proxy support. *(Optional, with `httpx[socks]`)*136* `rich` - Rich terminal support. *(Optional, with `httpx[cli]`)*137* `click` - Command line client support. *(Optional, with `httpx[cli]`)*138* `brotli` or `brotlicffi` - Decoding for "brotli" compressed responses. *(Optional, with `httpx[brotli]`)*

Add support for zstd decoding (#3139)Michiel W. Beijenbefore adoption392dbe4

line 139why, one step back
139* `zstandard` - Decoding for "zstd" compressed responses. *(Optional, with `httpx[zstd]`)*

Ensure all WSGITransport environs have a SERVER_PROTOCOL (#2708)Peter Lazorchakbefore adoptionabb994c

lines 140–147why, 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---146147<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>