aztro

FREEMIUM
Verified
От Sameer Kumar | Обновлено 17 दिन पहले | Science
Популярность

0.5 / 10

Задержка

643ms

Уровень обслуживания

56%

Health Check

N/A

Назад ко всем обсуждениям

json typeerror

Rapid account: Quarks 1
Quarks1
2 वर्ष पहले

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 एक वर्ष पहले

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

Rapid account: Quarks 1
Quarks1 Commented 2 वर्ष पहले

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?

Присоединяйтесь к обсуждению – добавьте комментарий ниже:

Войдите / Зарегистрируйтесь, чтобы публиковать новые комментарии