I have installed elasticsearch 7.6.1 on an AWS EC2 instance.
When I give the following curl command from Windows I get a valid JSON response: curl -XGET "http://<EC2-IP>:9200"
However when I give the following command: curl -XPOST "http://<EC2-IP>:9200/table_search_index/_doc/<doc_id>" -H 'Content-Type: application/json' -d'{<json_doc>}'
I get the error: {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}
Thanks for the link.
I checked the header generated when I clicked on the copy as cUrl button.
The header generated by it was -H 'Content-Type: application/json' which is the same header I have mentioned in the command I gave to POST my data.
So is there any other reason for the failure?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.