0
votes

My pc is windows 10. I want to use curl command to get the data from elasticsearch, but I have some problems. this is my curl command (a small test): curl "http://localhost:9200/_search" -d '{"query": {"match_all": {}}}'

and the cmd show the error:

{"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

could anyone help me?

thank you in advance.

1

1 Answers

2
votes

It seems like you need to provide the proper Content-Type header as well:

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