I am trying to make a request from one server to another to perform a registration, but this error is always returned to me:
Failed to load link : Response to preflight request does not pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' link ' is therefore not allowed access.
My request looks like this:
var config = {
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PATCH, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': '*',
'token': 'meu_token'
}
};
this.$http.post('http://dominio_da_api/services/criarConta', this.dados, config).then(response => {
I used a chrome extension for CORS tests, when it is enabled it works normally, but when I disable it, it generates this error. I am using CodeIgniter and for the Vue-resource requests, I have also used the axios, but it returns the same error