Skip to content
Myr

Merge pull request #1296 from sursh/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Add helpful error message to r.json() method

authored by Kenneth Reitz · committed by Kenneth Reitz · parents fa9234d, 8ebeb3d · Browse files · 1 file+3 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:docs/user/quickstart.rst+3 added-1 removed
129 unmodified lines
130 >>> r = requests.get('https://github.com/timeline.json')131 >>> r.json()132 [{u'repository': {u'open_issues': 0, u'url': 'https://github.com/...133134In case the JSON decoding fails, ``r.json`` raises an exception.134In case the JSON decoding fails, ``r.json`` raises an exception. For example, if135the response gets a 401 (Unauthorized), attempting ``r.json`` raises ``ValueError:136No JSON object could be decoded``137138139Raw Response Content140--------------------
277 unmodified lines