Skip to content
Myr

README_chinese.md

This file

Path

README_chinese.md

144 lines · 4.5 KiB · Markdown

Last changed by

Remove rfc3986 from Chinese readme (#2576)Paul Schreiberbefore adoption5747764

History of this file

Take it

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 1–4why, 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>4

Make chinese README better (#2366)chaojiebefore adoption27db352

line 5why, one step back
5<p align="center"><strong>HTTPX</strong> <em>- 适用于 Python 的下一代 HTTP 客户端</em></p>

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 6–15why, one step back
6
7<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

Make chinese README better (#2366)chaojiebefore adoption27db352

line 16why, one step back
16HTTPX 是适用于 Python3 的功能齐全的 HTTP 客户端。 它集成了 **一个命令行客户端**,同时支持 **HTTP/1.1 和 HTTP/2**,并提供了 **同步和异步 API**。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 17–19why, one step back
17
18---19

Make chinese README better (#2366)chaojiebefore adoption27db352

line 20why, one step back
20通过 pip 安装 HTTPX:

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 21–25why, one step back
21
22```shell23$ pip install httpx24```25

Make chinese README better (#2366)chaojiebefore adoption27db352

line 26why, one step back
26使用 httpx:

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 27–40why, one step back
27
28```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```40

Make chinese README better (#2366)chaojiebefore adoption27db352

line 41why, one step back
41或者使用命令行客户端。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 42–43why, one step back
42
43```shell

Make chinese README better (#2366)chaojiebefore adoption27db352

line 44why, one step back
44$ pip install 'httpx[cli]' # 命令行功能是可选的。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 45–46why, one step back
45```
46

Make chinese README better (#2366)chaojiebefore adoption27db352

line 47why, one step back
47它允许我们直接通过命令行来使用 HTTPX...

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 48–60why, one step back
48
49<p align="center">50 <img width="700" src="docs/img/httpx-help.png" alt='httpx --help'>51</p>5253发送一个请求...5455<p align="center">56 <img width="700" src="docs/img/httpx-request.png" alt='httpx http://httpbin.org/json'>57</p>5859## 特性60

Make chinese README better (#2366)chaojiebefore adoption27db352

line 61why, one step back
61HTTPX 建立在成熟的 requests 可用性基础上,为您提供以下功能:

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 62why, one step back
62

Make chinese README better (#2366)chaojiebefore adoption27db352

lines 63–70why, one step back
63* 广泛的 [requests 兼容 API](https://www.python-httpx.org/compatibility/)。
64* 内置的命令行客户端功能。65* HTTP/1.1 [和 HTTP/2 支持](https://www.python-httpx.org/http2/)。66* 标准同步接口,也支持 [异步](https://www.python-httpx.org/async/)。67* 能够直接向 [WSGI 应用发送请求](https://www.python-httpx.org/advanced/#calling-into-python-web-apps) 或向 [ASGI 应用发送请求](https://www.python-httpx.org/async/#calling-into-python-web-apps)。68* 每一处严格的超时控制。69* 完整的类型注解。70* 100% 测试。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 71why, one step back
71

Make chinese README better (#2366)chaojiebefore adoption27db352

line 72why, one step back
72加上这些应该具备的标准功能...

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 73why, one step back
73

Make chinese README better (#2366)chaojiebefore adoption27db352

lines 74–79why, one step back
74* 国际化域名与 URL
75* Keep-Alive & 连接池76* Cookie 持久性会话77* 浏览器风格的 SSL 验证78* 基础或摘要身份验证79* 优雅的键值 Cookies

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 80–81why, one step back
80* 自动解压缩
81* 内容自动解码

Make chinese README better (#2366)chaojiebefore adoption27db352

line 82why, one step back
82* Unicode 响应正文

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 83why, one step back
83* 分段文件上传

Make chinese README better (#2366)chaojiebefore adoption27db352

lines 84–85why, one step back
84* HTTP(S)代理支持
85* 可配置的连接超时

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 86why, one step back
86* 流式下载

Make chinese README better (#2366)chaojiebefore adoption27db352

lines 87–88why, one step back
87* .netrc 支持
88* 分块请求

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 89–91why, one step back
89
90## 安装91

Make chinese README better (#2366)chaojiebefore adoption27db352

line 92why, one step back
92使用 pip 安装:

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 93–97why, one step back
93
94```shell95$ pip install httpx96```97

Make chinese README better (#2366)chaojiebefore adoption27db352

line 98why, one step back
98或者,安装可选的 HTTP/2 支持:

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 99–103why, one step back
99
100```shell101$ pip install httpx[http2]102```103

Make chinese README better (#2366)chaojiebefore adoption27db352

line 104why, one step back
104HTTPX 要求 Python 3.7+ 版本。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 105–107why, one step back
105
106## 文档107

Make chinese README better (#2366)chaojiebefore adoption27db352

line 108why, one step back
108项目文档现已就绪,请访问 [https://www.python-httpx.org/](https://www.python-httpx.org/) 来阅读。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 109why, one step back
109

Make chinese README better (#2366)chaojiebefore adoption27db352

line 110why, one step back
110要浏览所有基础知识,请访问 [快速开始](https://www.python-httpx.org/quickstart/)。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 111why, one step back
111

Make chinese README better (#2366)chaojiebefore adoption27db352

line 112why, one step back
112更高级的主题,可参阅 [高级用法](https://www.python-httpx.org/advanced/) 章节, [异步支持](https://www.python-httpx.org/async/) 或者 [HTTP/2](https://www.python-httpx.org/http2/) 章节。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 113why, one step back
113

Make chinese README better (#2366)chaojiebefore adoption27db352

line 114why, one step back
114[Developer Interface](https://www.python-httpx.org/api/) 提供了全面的 API 参考。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 115why, one step back
115

Make chinese README better (#2366)chaojiebefore adoption27db352

line 116why, one step back
116要了解与 HTTPX 集成的工具, 请访问 [第三方包](https://www.python-httpx.org/third_party_packages/)。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 117–119why, one step back
117
118## 贡献119

Make chinese README better (#2366)chaojiebefore adoption27db352

line 120why, one step back
120如果您想对本项目做出贡献,请访问 [贡献者指南](https://www.python-httpx.org/contributing/) 来了解如何开始。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

lines 121–123why, one step back
121
122## 依赖123

Make chinese README better (#2366)chaojiebefore adoption27db352

line 124why, one step back
124HTTPX 项目依赖于这些优秀的库:

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 125why, one step back
125

Make chinese README better (#2366)chaojiebefore adoption27db352

lines 126–128why, one step back
126* `httpcore` - `httpx` 基础传输接口实现。
127 * `h11` - HTTP/1.1 支持。128* `certifi` - SSL 证书。

Remove rfc3986 from Chinese readme (#2576)Paul Schreiberbefore adoption5747764

line 129why, one step back
129* `idna` - 国际化域名支持。

Make chinese README better (#2366)chaojiebefore adoption27db352

line 130why, one step back
130* `sniffio` - 异步库自动检测。

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 131why, one step back
131

Make chinese README better (#2366)chaojiebefore adoption27db352

line 132why, one step back
132以及这些可选的安装:

readmes/README.scn.md (#1946)Kevin Andersonbefore adoptione232226

line 133why, one step back
133

Make chinese README better (#2366)chaojiebefore adoption27db352

lines 134–144why, one step back
134* `h2` - HTTP/2 支持。 *(可选的,通过 `httpx[http2]`)*
135* `socksio` - SOCKS 代理支持。 *(可选的, 通过 `httpx[socks]`)*136* `rich` - 丰富的终端支持。 *(可选的,通过 `httpx[cli]`)*137* `click` - 命令行客户端支持。 *(可选的,通过 `httpx[cli]`)*138* `brotli` 或者 `brotlicffi` - 对 “brotli” 压缩响应的解码。*(可选的,通过 `httpx[brotli]`)*139140这项工作的大量功劳都归功于参考了 `requests` 所遵循的 API 结构,以及 `urllib3` 中众多围绕底层网络细节的设计灵感。141142---143144<p align="center"><i>HTTPX 使用 <a href="https://github.com/encode/httpx/blob/master/LICENSE.md">BSD 开源协议</a> code。<br/>精心设计和制作。</i><br/>&mdash; 🦋 &mdash;</p>