Requests
外觀
| 原作者 | Kenneth Reitz |
|---|---|
| 開發者 | Kenneth Reitz, Cory Benfield, Ian Stapleton Cordasco, Nate Prewitt |
| 首次發布 | 2011年2月14日 |
| 目前版本 | 2.32.5[1] |
| 原始碼庫 | |
| 程式語言 | Python |
| 作業系統 | 跨平台 |
| 許可協定 | Apache許可證2.0 |
| 網站 | requests |
Requests是一個Python HTTP庫,在Apache License 2.0 許可證下發行。這個專案的目標是使HTTP請求更簡單,更人性化。Requests是沒有預設包含在Python內的最流行的Python庫之一[2],因此有人建議將其預設隨Python一起發布[3]。
範例代碼
[編輯]>>> 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.5. 2025年8月18日 [2025年9月13日].
- ^ 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).
外部連結
[編輯]| 這是一篇與軟體相關的小作品。您可以透過編輯或修訂擴充其內容。 |