I tried the following code in Postman and it was working. Is there something wrong with the code?
$.ajax({
url: 'http://api.example.com/users/get',
type: 'POST',
headers: {
'name-api-key':'ewf45r4435trge',
},
data: {
'uid':36,
},
success: function(data) {
console.log(data);
}
});
I got this error in my console as below, please advise.
XMLHttpRequest cannot load http://api.example.com/users/get Response
for preflight is invalid (redirect)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…