0
我正在嘗試使ajax致電blogger.com。該呼叫回顧用戶的數據。我使用這個https://developers.google.com/blogger/docs/3.0/作爲參考。以下是我寫的ajax。ajax致電博客API
var getUserDetail = function(){
var url = "https://www.googleapis.com/blogger/v3/users/self";
$.ajax({
url: url,
type: 'GET',
beforeSend: function (request)
{
request.setRequestHeader("Authorization","oauth_token_I_got");
},
}).done(function(data) {
console.log(data)
},"json");
}
我得到401錯誤,每當我嘗試撥打電話
錯誤
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
的進一步跟蹤我在哪裏錯了嗎?由於