我正在使用这样的 python 请求查询 API...
url = "www.example.com"
response = requests.request("POST", url)
response
--------
[
{
"id": "485744",
"descript": "firstitem",
},
{
"id": "635456",
"descript": "seconditem",
},
{
"id": "765554",
"descript": "thirditem",
},
]
我正在尝试像这样访问响应中的第一项...
response = response.json
print(response[0])
但我收到错误...
TypeError: 'method' object is not subscriptable
我哪里错了?
开心每一天1111
繁星coding
相关分类