【发布时间】:2010-08-31 16:44:20
【问题描述】:
我正在尝试向 google authSub 发布请求以获取 youtube。我将 jQuery 用于 AJAX 帖子等。当我发布 POST 时出现 405 错误:“405 Method Not Allowed”。
这是我的 js:
$.ajax({
type: 'POST',
url: "https://www.google.com/accounts/AuthSubRequest",
beforeSend: function(xhr){
xhr.setRequestHeader('X-GData-Key', 'key="' + ytKey + '"');
},
success: function(oData){
//alert(oData);
},
scope: 'http://gdata.youtube.com',
alt: 'json',
next: 'http://' + globalBrand + '/sitecreator/view.do',
session: 1
});
我在 API 中为此使用的页面是 here。
这是错误的样子:
【问题讨论】:
-
您能否提供您正在使用的 HTML 和 JS 的链接?我正在尝试完成同样的事情,但我不确定如何实现 ajax js。
标签: javascript ajax jquery youtube-api