splunkrestapi:201与curl,404与python?

2024-05-13 12:06:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试针对Splunk REST Api请求。使用curl调用Api时,它的工作效率更高:

curl -k  https://host:8090/services/collector/event -H "Authorization: Splunk AUTH_CODE" -d '{"event":"Hello, World!","source":"Airwatch","index":"client-myclient"}'
{"text":"Success","code":0}%

但当我试图在python中拉取相同的请求时,我得到了404错误:

^{pr2}$

我知道不安全的警告来自于我的verify=false。头似乎穿过了(splunkResponse.erquest.headers我的不同测试没有给出任何结果。。。在

我错过了什么?在


Tags: httpsautheventrestapihosthelloworld