Merge pull request #3671 from chris-martin/json-ValueError

Document that Response.json() may raise ValueError
This commit is contained in:
2016-11-10 18:18:16 -05:00
committed by GitHub
+1
View File
@@ -818,6 +818,7 @@ class Response(object):
"""Returns the json-encoded content of a response, if any.
:param \*\*kwargs: Optional arguments that ``json.loads`` takes.
:raises ValueError: If the response body does not contain valid json.
"""
if not self.encoding and self.content and len(self.content) > 3: