【发布时间】:2018-11-23 11:53:45
【问题描述】:
选项 https://fcm.googleapis.com/fcm/send 404 ()
无法加载 https://fcm.googleapis.com/fcm/send:预检响应没有 HTTP ok 状态。
{readyState: 0, getResponseHeader: ƒ, getAllResponseHeaders: ƒ,
setRequestHeader: ƒ, overrideMimeType: ƒ, …}
XHR 加载失败:OPTIONS "https://fcm.googleapis.com/fcm/send"。
这是我的代码:
$.ajax({
type: 'POST',
url: 'https://fcm.googleapis.com/fcm/send',
headers: {
'Content-Type': 'application/json',
'Authorization': 'key=*********'
},
data: {
"to" : '*****************************',
"data" : {
"phone" : "99*****",
"id" : "5****"
}
},
success: function(response){
console.log("success");
},
error : function(response) {
console.log(response);
}
});
【问题讨论】:
标签: javascript json ajax firebase firebase-cloud-messaging