gpt4 book ai didi

python - <>

转载 作者:太空狗 更新时间:2023-10-29 20:33:44 26 4
gpt4 key购买 nike

我试图向 https://randomuser.me/api/ 发出请求 GET

import requests
import json


url = "https://randomuser.me/api/"
data = requests.get(url).json

print data

我不断得到

# <bound method Response.json of <Response [200]>>

如何查看 json 响应?像这样的东西

{
"results": [
{
"user": {
"gender": "female",
"name": {
"title": "ms",
"first": "kerttu",
"last": "tervo"
},
"location": {
"street": "9102 aleksanterinkatu",
"city": "eurajoki",
"state": "pirkanmaa",
"zip": 67561
},
"email": "kerttu.tervo@example.com",
"username": "silvercat709",
"password": "papa",
"salt": "tOCPX2GL",
"md5": "86c60371eeb94596916d66cee898c869",
"sha1": "d06c4f2e43f8c0e53d88e538655f1152169ce575",
"sha256": "5a6b011841b27b08c38d2091dfb3d7ca50f55192ca0fcf6929dae098316c9aae",
"registered": 1419602511,
"dob": 1266822680,
"phone": "03-479-964",
"cell": "047-950-61-69",
"HETU": "220210A290R",
"picture": {
"large": "https://randomuser.me/api/portraits/women/68.jpg",
"medium": "https://randomuser.me/api/portraits/med/women/68.jpg",
"thumbnail": "https://randomuser.me/api/portraits/thumb/women/68.jpg"
}
}
}
],
"nationality": "FI",
"seed": "7d24284202c2cfdb06",
"version": "0.8"
}

最佳答案

实际上你应该调用它(因为有方法)。

data = requests.get(url).json()

关于python - <<Response[200]的绑定(bind)方法Response.json>>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36240495/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com