From a49c387b7af58e36f7a1266618595b3078be41fd Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Thu, 10 Nov 2016 16:26:07 -0500 Subject: [PATCH] Document that Response.json() may raise ValueError --- requests/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/requests/models.py b/requests/models.py index eac7c7d5..a4bd41b1 100644 --- a/requests/models.py +++ b/requests/models.py @@ -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: