Skip to content

使用curl调用api需要加Content-Type头 #592

Open
@panzhongxian

Description

@panzhongxian

Elasticsearch: 权威指南 » 基础入门 » 你知道的, 为了搜索… » 和 Elasticsearch 交互

curl示例中,需要指定Content-Type。

curl -H 'Content-Type: application/json' -X GET 'http://localhost:9200/_count?pretty' -d '
{
    "query": {
        "match_all": {}
    }
}
'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions