Skip to content

Commit c0ae3dd

Browse files
author
Kenneth Reitz
committed
more examples
psf#657
1 parent dda9689 commit c0ae3dd

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎docs/index.rst‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@ Things shouldn’t be this way. Not in Python.
1818

1919
::
2020

21-
>>> r = requests.get('https://api.github.com', auth=('user', 'pass'))
21+
>>> r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
2222
>>> r.status_code
23-
204
23+
200
2424
>>> r.headers['content-type']
25-
'application/json'
25+
'application/json; charset=utf8'
26+
>>> r.encoding
27+
'utf-8'
2628
>>> r.text
27-
...
29+
u'{"type":"User"...'
30+
>>> r.json
31+
{u'private_gists': 419, u'total_private_repos': 77, ...}
2832

29-
See `the same code, without Requests <https://gist.github.com/973705>`_.
33+
See `similar code, without Requests <https://gist.github.com/973705>`_.
3034

3135
Requests 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.
3236

0 commit comments

Comments
 (0)