I wanna create Ajax request from empty HTML with jQuery. I do like this
$.ajax({
url: "http://****.com/rest/V1/integration/admin/token?username=***&password=****",
type: "POST",
success: function (d) {
alert(d);
}
});
but always I get error
Access to XMLHttpRequest at 'http://localhost:8000/rest/V1/integration/admin/token?username=magento&password=magento2' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I know I should add some header before send request but jquery does not support headers. Anyone gets this error?