From c0ae3dd31e7b87a697e763185c2f6f284363d0de Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Jun 2012 03:09:19 +0200 Subject: [PATCH] more examples #657 --- docs/index.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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. -- 2.7.4