0
我試圖使用AJAX調用按本單證在打火登錄:jQuery的AJAX調用與頭
https://gist.github.com/rtt/10403467
這裏,有表:請求頭
和鏈接登錄是這樣的:> curl -X POST https://api.gotinder.com/auth --data '{"facebook_token": fb_token, "facebook_id": fb_user_id}
'
我唯一的願望就是使用這種方法成功登錄:
這是我曾嘗試: -
$("#btnSend").click(function() {
var dataUrl = "https://api.gotinder.com/auth";
var fbtoken = "[i wrote correct fb token here]";
var fbId = "[i wrote correct fb id here]";
var datavalue = '{"facebook_token": "' + fbtoken + '", "facebook_id": "' + fbId + '"}';
jQuery.ajax({
async: false,
type: "POST",
beforeSend: function (request) {
//request.setRequestHeader("X-Auth-Token",)
request.setRequestHeader("Accept-Language", "en;q=1, fr;q=0.9, de;q=0.8, ja;q=0.7, nl;q=0.6, it;q=0.5");
request.setRequestHeader("Accept", "*/*");
request.setRequestHeader("UserAgent", "Tinder/3.0.2 (iPhone; iOS 7.1; Scale/2.00)");
request.setRequestHeader("Accept-Encoding", "gzip, deflate");
},
headers: {"UserAgent": "Tinder/3.0.2 (iPhone; iOS 7.1; Scale/2.00)"},
contentType: "application/json",
dataType: "json",
data: datavalue,
url: dataUrl,
success: function (data) {
console.dir(data);
},
error: function (msg) {
}
});
});
你能幫設置在請求的正確頭?
請添加關於這與問題相關的解釋。 – 2014-10-09 12:24:07