Ensure all json loads calls use strings
This commit is contained in:
parent
cf3b9782ac
commit
e0e4d4c87f
7 changed files with 36 additions and 4 deletions
|
@ -137,7 +137,11 @@ class ApiRequest(object):
|
|||
|
||||
try:
|
||||
if content_type == 'application/json':
|
||||
data = json.loads(response)
|
||||
try:
|
||||
response = response.decode()
|
||||
except (UnicodeDecodeError, AttributeError):
|
||||
pass
|
||||
data = json.loads(response.decode)
|
||||
return data
|
||||
else:
|
||||
raise InvalidContentType()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue