From 1164450dac7576e6e77d0c5976fbc0bb7111cd1c Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Wed, 6 Jun 2012 16:59:20 +0200 Subject: [PATCH] Added r.json documentation (document ALL the awesome features!) --- docs/user/quickstart.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 775970e..316d9a1 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -111,6 +111,19 @@ use the following code: >>> i = Image.open(StringIO(r.content)) +JSON Response Content +--------------------- + +There's also a builtin JSON decoder, in case you're dealing with JSON data:: + + >>> import requests + >>> r = requests.get('https://github.com/timeline.json') + >>> r.json + [{u'repository': {u'open_issues': 0, u'url': 'https://github.com/... + +In case the JSON decoding fails, ``r.json`` simply returns ``None``. + + Raw Response Content -------------------- -- 2.34.1