2016-05-30 54 views
0

我已經嘗試了很多,但不能使POST通過XMLHttpRequest的 發送此它的代碼POST的XmlHttpRequest不行

var xhr = new XMLHttpRequest(); 
var params="device=android&device_token="+Notifications.remote.token" 
xhr.open("POST", "https://xxx.xxx.it/test.php",true); 
xhr.setRequestHeader("Access_Token", "11bdf06b9fda0639b300c023cb0b3ba5"); 
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); 
xhr.setRequestHeader("Content-length", params.length); 
xhr.send(params); 

頁被稱爲,但沒有被傳遞..沒有ACCESS_TOKEN並沒有POST值

回答

0

如果您使用的是桌面版本,則不能這樣做。您必須使用WebClient類,因爲Smartface已更新到Cloud並將其刪除(或至少隱藏了它),所以我找不到桌面文檔,對不起。但是Stack Overflow還有另一個問題,我解釋瞭如何將Firebase與Smartface一起使用,爲了更好的理解,我建議閱讀它。
How to create a webservice for a login system?

希望有幫助! :)