如何使用python在json中以json的格式获取响应?
# Request
curl -H "Authorization: Bearer <personal_access_token>"
\https://app.asana.com/api/1.0/projects/1331
答案 0 :(得分:2)
import requests
url = 'https://app.asana.com/api/1.0/projects/1331'
headers = {'Authorization': 'Bearer {}'.format(token)}
response = requests.get(url, headers=headers).json()
答案 1 :(得分:0)
您应该可以使用requests
模块
import requests
requests.get('https://app.asana.com/api/1.0/projects/1331',headers={'Authorization': 'Bearer <personal_access_token>'}).json()