aztro

免费增值
通过 Sameer Kumar | 已更新 il y a 22 jours | Science
人气

0.4 / 10

延迟

635ms

服务等级

44%

Health Check

N/A

返回所有讨论

json typeerror

Rapid account: Quarks 1
Quarks1
il y a 2 ans

I’m currently having an issue where randomly I’ll get the error “TypeError: the JSOn osbjext must be str, bytes, or bytearray, not dict” when trying to do json.loads. It’s weird because it works sometimes, but then other times causes this error without changing the code at all. Do you know why this happens?

Rapid account: Sameer Kumar
sameer.kumar Commented il y a un an

Likely issue is in
**new_response = json.loads(response.json())**
replace it with new_response = response.json()

Rapid account: Quarks 1
Quarks1 Commented il y a 2 ans

I am trying to extract the “description” part of the response
to do this i am doing
new_response = json.loads(response.json())
description = new_response[“description”]

This is all in python, am I doing something wrong?

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论