2024-04-24 06:32:26 发布
网友
response = requests.get(api).json print(type(response)) data = json.loads(response)
我得到了<class method>和错误: JSON object must be str, bytes or bytearray, not method
<class method>
JSON object must be str, bytes or bytearray, not method
有人能帮忙把它转换成dict吗
写入response = requests.get(api).json时,将json方法本身存储在response中,而不是调用该方法并将该方法调用的结果存储在response
response = requests.get(api).json
json
response
如果将其更改为requests.get(api).json(),并在末尾加上括号,则将调用该方法而不是仅引用它,并将结果存储在response
requests.get(api).json()
写入
response = requests.get(api).json
时,将json
方法本身存储在response
中,而不是调用该方法并将该方法调用的结果存储在response
如果将其更改为
requests.get(api).json()
,并在末尾加上括号,则将调用该方法而不是仅引用它,并将结果存储在response
相关问题 更多 >
编程相关推荐