I have a Elasticsearch cluster running on Centos 6 with Java. Whenever I am trying to run a query from my client side made with AngularJs I get the following error,
Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response
I have put the following code in my config/elasticsearch.yml file.
http.cors.enabled : true
http.cors.allow-origin : "*"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length
http.cors.allow-credentials : true
What am I doing wrong? Thanks in advance.