Merge pull request #1296 from sursh/master

Add helpful error message to r.json() method
This commit is contained in:
Kenneth Reitz
2013-04-08 11:01:36 -07:00
+3 -1
View File
@@ -131,7 +131,9 @@ There's also a builtin JSON decoder, in case you're dealing with JSON data::
>>> r.json()
[{u'repository': {u'open_issues': 0, u'url': 'https://github.com/...
In case the JSON decoding fails, ``r.json`` raises an exception.
In case the JSON decoding fails, ``r.json`` raises an exception. For example, if
the response gets a 401 (Unauthorized), attempting ``r.json`` raises ``ValueError:
No JSON object could be decoded``
Raw Response Content