README.md
This file
Path
README.md
149 lines · 4.8 KiB · Markdown
Last changed by
Revert "Removed leading $ from cli code blocks" (#3192)Tom Christiebefore adoptionf06171f
History of this fileTake it
The walk stopped after 200 commits: lines older than 7455c00 point at it.
Update PULL_REQUEST_TEMPLATE.md (#2668)Marcelo Trylesinskibefore adoption7455c00
lines 1–24why, one step back1<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>1516HTTPX 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**.1920---2122Install HTTPX using pip:2324```shellRevert "Removed leading $ from cli code blocks" (#3192)Tom Christiebefore adoptionf06171f
line 25why, one step back25$ pip install httpxUpdate PULL_REQUEST_TEMPLATE.md (#2668)Marcelo Trylesinskibefore adoption7455c00
lines 26–45why, one step back26```2728Now, let's get started:2930```pycon31>>> 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```4243Or, using the command-line client.4445```shellRevert "Removed leading $ from cli code blocks" (#3192)Tom Christiebefore adoptionf06171f
line 46why, one step back46$ pip install 'httpx[cli]' # The command line client is an optional dependency.Update PULL_REQUEST_TEMPLATE.md (#2668)Marcelo Trylesinskibefore adoption7455c00
lines 47–68why, one step back47```4849Which 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>6061## Features6263HTTPX builds on the well-established usability of `requests`, and gives you:6465* A broadly [requests-compatible API](https://www.python-httpx.org/compatibility/).66* An integrated command-line client.67* HTTP/1.1 [and HTTP/2 support](https://www.python-httpx.org/http2/).68* 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 69why, one step back69* 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).Update PULL_REQUEST_TEMPLATE.md (#2668)Marcelo Trylesinskibefore adoption7455c00
lines 70–96why, one step back70* 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```shellRevert "Removed leading $ from cli code blocks" (#3192)Tom Christiebefore adoptionf06171f
line 97why, one step back97$ pip install httpxUpdate PULL_REQUEST_TEMPLATE.md (#2668)Marcelo Trylesinskibefore adoption7455c00
lines 98–102why, one step back98```99100Or, to include the optional HTTP/2 support, use:101102```shellRevert "Removed leading $ from cli code blocks" (#3192)Tom Christiebefore adoptionf06171f
line 103why, one step back103$ pip install httpx[http2]Update PULL_REQUEST_TEMPLATE.md (#2668)Marcelo Trylesinskibefore adoption7455c00
lines 104–105why, one step back104```105Drop support for Python 3.7 (#2813)Iurii Plinerbefore adoptionb40c04d
line 106why, one step back106HTTPX requires Python 3.8+.Update PULL_REQUEST_TEMPLATE.md (#2668)Marcelo Trylesinskibefore adoption7455c00
lines 107–140why, one step back107108## 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.117118To find out about tools that integrate with HTTPX, see [Third Party Packages](https://www.python-httpx.org/third_party_packages/).119120## 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.131* `idna` - Internationalized domain name support.132* `sniffio` - Async library autodetection.133134As well as these optional installs:135136* `h2` - HTTP/2 support. *(Optional, with `httpx[http2]`)*137* `socksio` - SOCKS proxy support. *(Optional, with `httpx[socks]`)*138* `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]`)*Add support for zstd decoding (#3139)Michiel W. Beijenbefore adoption392dbe4
line 141why, one step back141* `zstandard` - Decoding for "zstd" compressed responses. *(Optional, with `httpx[zstd]`)*Update PULL_REQUEST_TEMPLATE.md (#2668)Marcelo Trylesinskibefore adoption7455c00
lines 142–149why, 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---148149<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/>— 🦋 —</p>