Elasticsearch Error: "Content-Type header [application/x-www-form-urlencoded] is not supported"
·
问题背景:
执行计算集群中文档数量的命令:
curl -XPOST 'http://localhost:9200/_count?pretty' -d '
{
"query":{
"match_all":{}
}
}'
提示如下:

解决:
在命令中添加 -H "Content-Type:application/json"即可。
curl -H "Content-Type:application/json" -XPOST 'http://localhost:9200/_count?pretty' -d '
{
"query":{
"match_all":{}
}
}'
更多推荐


所有评论(0)