我运行了一个Elasticsearch节点,我可以使用chrome成功地从网址localhost:8882/rest/search/all
收到Json响应。
然而,当我从这样的反应中调用它时:
var config = {
headers: {'Access-Control-Allow-Origin': '*',
'Accept': 'application/json',
'Content-Type': 'application/json',
}
};
axios.get('http://localhost:8882/rest/search/all',config).then(function (response) {...
我收到403错误:
Failed to load localhost:8882/rest/search/all; Response to preflight request doesn't pass access control check : No 'Access-Control-Allow-Origin' header is present on the requested resource