commit | 6ab16db7bd55bc63dca2b6ef8ad04d37117927af | [log] [tgz] |
---|---|---|
author | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | Sat Dec 12 17:29:02 2020 |
committer | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | Fri Dec 25 15:41:39 2020 |
tree | 79832bc6977db0a1c19923e0d6df76760af2289b | |
parent | d3e0f73354051f824cae563aeae215006158da28 [diff] |
Pass urllib3.SKIP_HEADER when headers should be unset urllib3 introduced some default headers and a way to skip them if desired. Let's use that sentinel value to pass along information about Requests' users desire to skip those headers as well. Closes gh-5671
Requests is a simple, yet elegant HTTP library.
>>> import requests >>> r = requests.get('https://api.github.com/user', auth=('user', 'pass')) >>> r.status_code 200 >>> r.headers['content-type'] 'application/json; charset=utf8' >>> r.encoding 'utf-8' >>> r.text '{"type":"User"...' >>> r.json() {'disk_usage': 368627, 'private_gists': 484, ...}
Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your PUT
& POST
data — but nowadays, just use the json
method!
Requests is one of the most downloaded Python package today, pulling in around 14M downloads / week
— according to GitHub, Requests is currently depended upon by 500,000+
repositories. You may certainly put your trust in this code.
Requests is available on PyPI:
$ python -m pip install requests
Requests officially supports Python 2.7 & 3.5+.
Requests is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today.
dict
–like Cookies.netrc