【发布时间】:2019-11-30 20:27:06
【问题描述】:
我在使用 curl 的 API 查询下运行我得到 json 响应。
curl -X POST -H 'Content-Type: application/json' -H 'X-Metabase-Session: sdfeffff-sdfdf-ffff-ffff-fffffffff' https://dash.test.sh/api/card/140/query/json
但是当我尝试使用 python 请求运行相同的查询时,我得到了响应
"API endpoint does not exist."
下面是我正在尝试的python代码
import requests
url = 'https://dash.test.sh/api/card/140/query/json'
header = {
'X-Metabase-Session': 'sdfeffff-sdfdf-ffff-ffff-fffffffff'
}
response = requests.get(url, headers=header)
print (response.text)
我期望实际的 json 内容
【问题讨论】:
标签: python authentication curl python-requests access-token