2

I want to send data in the format json a elasticsearch but I can not do it

I'm using elasticsearch version 7.0.1 and curl 7.64, I'm on windows 10

curl -X PUT "localhost:9200/customer/_doc/1?pretty" -H 'Content-Type: application/json' -d'
{
  "name": "John Doe"
}
'

i have this error messages :

{
"error" : "Content-Type header [application/x-www-form-urlencoded] is not supported", "status" : 406

}

curl: (6) Could not resolve host: application

curl: (3) URL using bad/illegal format or missing URL

1 Answer 1

5

On Windows, you need to use double quotes everywhere, not single quotes:

curl -X PUT "localhost:9200/customer/_doc/1?pretty" -H "Content-Type: application/json" -d "{ \"name\": \"John Doe\" }"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.