mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
keep json None fo row
This commit is contained in:
+8
-4
@@ -1048,10 +1048,14 @@ class Response(BaseResponse):
|
||||
# a best guess).
|
||||
encoding = guess_json_utf(self.content)
|
||||
if encoding is not None:
|
||||
return json.loads(self.content.decode(encoding))
|
||||
|
||||
return json.loads(self.text or self.content)
|
||||
|
||||
try:
|
||||
return json.loads(self.content.decode(encoding))
|
||||
except (ValueError, UnicodeDecodeError):
|
||||
pass
|
||||
try:
|
||||
return json.loads(self.text or self.content)
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
@property
|
||||
def links(self):
|
||||
|
||||
Reference in New Issue
Block a user