{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}
-
If you see the following error when using curl, it means it does not understand the format in the file. Here we're trying to create an index in elasticsearch using a file.
curl -s -XPOST localhost:9200/products/_bulk --data-binary @products.json {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}
As the content is json format add
-H 'Content-Type: application/json'
curl -s -XPOST localhost:9200/products/_bulk -H 'Content-Type: application/json' --data-binary @products
© Lightnetics 2024