0
Personal I am trying to make a request from one server to another to perform a registration, but I always get returned this error:
Failed to load http://domain: Response to preflight request doesn’t pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested Resource. Origin 'http://dominio_que_solicita.com.br' is therefore not allowed access.
My requisition is 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 works normally, but when I disable it generates this error. I am using Codeigniter and for the requests Vue-Resource, tbm I used Axios, but it returns me the same error
Possible duplicate of CORS - No 'Access-Control-Allow-Origin' header is present on the requested Resource
– BrTkCa
These CORS headers should be in the server response, not in the client request
– Costamilam