I have a rest API and when I call it in chrome console return this error:
Response for preflight is invalid (redirect)
But when I test this API in Postman everything is ok and work correctly.
this my code:
$.ajax({
type: 'GET',
dataType:'json',
headers: {
"Authorization":"Basic Ym86Ym8=",
"Accept":"application/json",
"Content-Type":"application/json"
},
contentType: 'application/json; charset=utf-8',
success(data, response) {
console.log(data, response);
},
url: 'http://##########/bo/api/v1/transactions/',
});
How i can fix this error?