Python 的 HTTP 客戶端庫,Requests 2.6.0 發布
Requests 是一個 Python 的 HTTP 客戶端庫。
示例代碼:
>>> r = requests.get('https://api.github.com', auth=('user', 'pass'))
>>> r.status_code
204
>>> r.headers['content-type']
'application/json'
>>> r.text
... Requests 2.6.0 發布,此版本現已提供下載:https://github.com/kennethreitz/requests/archive/v2.6.0.zip。
更新內容如下:
Bug 修復
-
Fix handling of cookies on redirect.
-
Fix error when requests is an
install_requiresdependency andpython setup.py testis run. (#2462) -
Fix error when urllib3 is unbundled and requests continues to use the vendored import location.
-
Include fixes to
urllib3's header handling. -
Requests' handling of unvendored dependencies is now more restrictive.
新特性和改進
-
Support bytearrays when passed as parameters in the
filesargument. (#2468) -
Avoid data duplication when creating a request with
str,bytes, orbytearrayinput to thefilesargument.
更多內容請看更新日志。
來自:http://www.oschina.net/news/60539/requests-2-6-0