From: Kenneth Reitz Date: Thu, 7 Jun 2012 01:09:19 +0000 (+0200) Subject: more examples X-Git-Tag: v0.13.1~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0ae3dd31e7b87a697e763185c2f6f284363d0de;p=services%2Fpython-requests.git more examples #657 --- diff --git a/docs/index.rst b/docs/index.rst index a3c98bc..ccd5734 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,15 +18,19 @@ Things shouldn’t be this way. Not in Python. :: - >>> r = requests.get('https://api.github.com', auth=('user', 'pass')) + >>> r = requests.get('https://api.github.com/user', auth=('user', 'pass')) >>> r.status_code - 204 + 200 >>> r.headers['content-type'] - 'application/json' + 'application/json; charset=utf8' + >>> r.encoding + 'utf-8' >>> r.text - ... + u'{"type":"User"...' + >>> r.json + {u'private_gists': 419, u'total_private_repos': 77, ...} -See `the same code, without Requests `_. +See `similar code, without Requests `_. 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 `_, which is embedded within Requests.