使用curl调用api需要加Content-Type头
panzhongxian opened this issue · 0 comments
panzhongxian commented
Elasticsearch: 权威指南 » 基础入门 » 你知道的, 为了搜索… » 和 Elasticsearch 交互
curl示例中,需要指定Content-Type。
curl -H 'Content-Type: application/json' -X GET 'http://localhost:9200/_count?pretty' -d '
{
"query": {
"match_all": {}
}
}
'