Skip to content
Myr

more examples

Before adoption: this commit came in with the history the project adopted, so no landing records it.

#657

authored by Kenneth Reitz · committed by Kenneth Reitz · parent dda9689 · Browse files · 1 file+9 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−5 removed

  • other:+9 added−5 removed

1 file+9 added−5 removed

modified:docs/index.rst+9 added-5 removed
16 unmodified lines
17Things shouldn’t be this way. Not in Python.1819::2021 >>> r = requests.get('https://api.github.com', auth=('user', 'pass'))21 >>> r = requests.get('https://api.github.com/user', auth=('user', 'pass'))22 >>> r.status_code23 20423 20024 >>> r.headers['content-type']25 'application/json'25 'application/json; charset=utf8'26 >>> r.encoding27 'utf-8'28 >>> r.text27 ...29 u'{"type":"User"...'30 >>> r.json31 {u'private_gists': 419, u'total_private_repos': 77, ...}3229See `the same code, without Requests <https://gist.github.com/973705>`_.33See `similar code, without Requests <https://gist.github.com/973705>`_.3435Requests takes all of the work out of Python HTTP/1.1 — making your integration with web services seamless. There's no need to manually add query strings to your URLs, or to form-encode your POST data. Keep-alive and HTTP connection pooling are 100% automatic, powered by `urllib3 <https://github.com/shazow/urllib3>`_, which is embedded within Requests.3637
101 unmodified lines