我有以下抛出的非常基本的代码: TypeError: the JSON object must be str, not 'bytes'
import requests
import json
url = 'my url'
user = 'my user'
pwd = 'my password'
response = requests.get(url, auth=(user, pwd))
if(myResponse.ok):
Data = json.loads(myResponse.content)
我尝试将 decode 设置为 Data 变量,如下所示,但它会抛出同样的错误; jData = json.loads(myResponse.content).decode('utf-8')
有什么建议吗?