我有一段非常基本的代码,出现了以下错误: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)
我尝试将解码设置为数据变量,如下所示,但它仍然抛出相同的错误:jData = json.loads(myResponse.content).decode('utf-8')
有任何建议吗?