gpt4 book ai didi

rest - 使用Restful API curl

转载 作者:行者123 更新时间:2023-12-03 00:54:29 27 4
gpt4 key购买 nike

我的电脑是Windows10。我想使用curl命令从elasticsearch获取数据,但是我有一些问题。
这是我的curl命令(一个小测试):
curl“http://localhost:9200/_search” -d'{“query”:{“match_all”:{}}}'

和cmd显示错误:
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}curl: (3) [globbing] unmatched brace in column 1
curl: (3) [globbing] empty string within braces in column 2

有人可以帮我吗?

先感谢您。

最佳答案

似乎您也需要提供适当的Content-Type header :

curl -H "Content-Type: application/json" -d '{"query": {"match_all": {}}}' "http://localhost:9200/_search"

关于rest - 使用Restful API curl ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46600908/

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