我无法使用jquery ajax访问api,这是我的代码。
$.ajax({
async: true,
method: "POST",
crossDomain: true,
headers: {
"Content-Type": "application/json"
},
xhrFields: {
withCredentials: true
},
url: "https://api.sample.com/bss/grp/noauth/GrpUserLogin",
data: {
"streamNo":"**********************",
"clientId":"**********************",
"clientSecret":"******************",
"userCode":"***************",
"langType":"en-US",
"password":"**************************",
"partnerCode":"*****************",
"mvnoCode":"******************"
},
success: function(msg) {
alert(JSON.stringify(msg));
}
});
这是我不断遇到的错误。
请帮助我。