【发布时间】:2022-11-11 07:53:06
【问题描述】:
我正在尝试向弹性搜索端点发出发布请求。 api 密钥是正确的,我从这个链接中引用:https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html 对于 api 密钥格式。 我的卷曲请求
curl -H "Authorization:ApiKey xxxxx"
\ -H "Content-Type:application/x-ndjson
-XPOST "https://712bbxxx/tttt/_bulk"
--data-binary "@sss.json"
错误信息:
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
400 Bad Request: invalid header name
我很确定引号符号和间距应该是正确的。请问您是否知道出了什么问题?
【问题讨论】:
-
是不是因为你忘记在
-H "Content-Type:application/x-ndjson之后关闭引号? -
是的,谢谢
标签: curl http-headers http-post