1

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
}
Kahbazi
  • 14,331
  • 3
  • 45
  • 76
Gopesh
  • 11
  • 3

1 Answers1

2

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

Panu Oksala
  • 3,245
  • 1
  • 18
  • 28