网页 综合 更新时间 2026-11-14 16:32:24

HTTPX

自动蜘蛛 www.python-httpx.org 正文约 1158 字
HTTPX 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.
Install HTTPX using pip:
Now, let's get started:
Or, using the command-line client.
Which now allows us to use HTTPX directly from the command-line...
Sending a request...
HTTPX builds on the well-established usability of requests, and gives you:
Plus all the standard features of requests...
For a run-through of all the basics, head over to the QuickStart.
For more advanced topics, see the Advanced section, the async support section, or the HTTP/2 section.
The Developer Interface provides a comprehensive API reference.
To find out about tools that integrate with HTTPX, see Third Party Packages.
The HTTPX project relies on these excellent libraries:
As well as these optional installs:
A huge amount of credit is due to requests for the API layout that much of this work follows, as well as to urllib3 for plenty of design inspiration around the lower-level networking details.
Or, to include the optional HTTP/2 support, use:
To include the optional brotli and zstandard decoders support, use:
HTTPX requires Python 3.9+
访问原文 返回搜索 https://www.python-httpx.org/
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。