Added r.json documentation (document ALL the awesome features!)
authorDanilo Bargen <gezuru@gmail.com>
Wed, 6 Jun 2012 14:59:20 +0000 (16:59 +0200)
committerDanilo Bargen <gezuru@gmail.com>
Wed, 6 Jun 2012 14:59:20 +0000 (16:59 +0200)
docs/user/quickstart.rst

index 775970e..316d9a1 100644 (file)
@@ -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
 --------------------