Content-Type header [application/x-www-form-urlencoded] is not supported on Elasticsearch

To fix this, add curl option -H 'Content-Type: application/json'


This error is due to strict content-type checking introduced in ElasticSearch 6.0, as explained in this post

Starting from Elasticsearch 6.0, all REST requests that include a body must also provide the correct content-type for that body.

Leave a Comment