Gopesh
Gopesh

Reputation: 11

Elastic Search is not working

When I am giving request to Elastic search my post and put is not working

My request

POST bird/admin/1
{
    "id":"1",
    "ity":"BSP"
}  

It should give success

But, getting error

{
   "error": "Content-Type header [application/x-www-form-urlencoded; charset=UTF-8] is not supported",
   "status": 406
}

Upvotes: 1

Views: 1656

Answers (1)

Panu Oksala
Panu Oksala

Reputation: 3438

You should use application/json content type.

If you are using curl, add -H 'Content-Type: application/json'

https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests

Upvotes: 2

Related Questions