I am unable to make an ajax query (POST with contentType: "application/
json") to elasticsearch server from google-chrome, because elastic
search seem to return this in response header by default
Access-Control-Allow-Methods:PUT, DELETE
thus following error is generated:
XMLHttpRequest cannot load http://localhost:9200/_search. Request
header field Content-Type is not allowed by Access-Control-Allow-
Headers.
It would be great if someone could chase down what needs to be returned
into order to support this, so there won't be a need to configure it
(unless you want to disable it completely). Seems like the spec has changed
since last I read it, and it might be different between browsers.
I am unable to make an ajax query (POST with contentType: "application/
json") to elasticsearch server from google-chrome, because elastic
search seem to return this in response header by default
Access-Control-Allow-Methods:PUT, DELETE
thus following error is generated:
XMLHttpRequest cannot load http://localhost:9200/_search. Request
header field Content-Type is not allowed by Access-Control-Allow-
Headers.
Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type
then it should work (since a POST request with content-
type:application/json is preflighted, and the response header is
checked for allowed methods). It would be great if someone with
knowledge of http cors can shed more light on this and propose a more
generic and encompassing change to Elasticsearch headers.
It would be great if someone could chase down what needs to be returned
into order to support this, so there won't be a need to configure it
(unless you want to disable it completely). Seems like the spec has changed
since last I read it, and it might be different between browsers.
I am unable to make an ajax query (POST with contentType: "application/
json") to elasticsearch server from google-chrome, because elastic
search seem to return this in response header by default
Access-Control-Allow-Methods:PUT, DELETE
thus following error is generated:
XMLHttpRequest cannot loadhttp://localhost:9200/_search. Request
header field Content-Type is not allowed by Access-Control-Allow-
Headers.
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.