Requests
原作者 | Kenneth Reitz |
---|---|
開發者 | Kenneth Reitz, Cory Benfield, Ian Stapleton Cordasco, Nate Prewitt |
首次发布 | 2011年2月14日 (2011-02-14) |
当前版本 |
|
源代码库 |
|
编程语言 | Python |
操作系统 | 跨平台 |
许可协议 | Apache许可证2.0 |
网站 | requests |
Requests是一个Python HTTP库,在Apache License 2.0 许可证下发行。这个项目的目标是使HTTP请求更简单,更人性化。Requests是没有默认包含在Python内的最流行的Python库之一[3],因此有人建议将其默认随Python一起发布[4]。
示例代码
>>> import requests >>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass')) >>> r.status_code 200 >>> r.headers['content-type'] 'application/json; charset=utf8' >>> r.encoding 'utf-8' >>> r.text '{"authenticated": true, ...' >>> r.json() {'authenticated': True, ...}
引用
- ^ Release 2.32.2. 2024年5月21日 [2024年5月25日].
- ^ Community Updates. [2021-03-12]. (原始内容存档于2021-03-07).
- ^ urllib.request — Extensible library for opening URL. [2021-03-13]. (原始内容存档于2021-05-28).
The Requests package is recommended for a higher-level HTTP client interface.
- ^ Beazly, David. R is for replacement (PDF). login. April 2012, 37 (2) [16 May 2020]. (原始内容 (PDF)存档于2017-08-24).
外部链接
- 官方网站
- GitHub上的requests頁面
这是一篇與软件相關的小作品。你可以通过编辑或修订扩充其内容。
|