这是我正在尝试的请求: https ://developers.google.com/youtube/2.0/developers_guide_protocol_playlists#Deleting_a_playlist
这是失败的请求:
$.ajax( {
dataType : 'json-p',
type : 'DELETE',
url : 'https://gdata.youtube.com/feeds/api/users/default/playlists/' + playlist_id + '?access_token=' + hash_values_json.access_token + '&alt=json',
headers : {
'Access-Control-Allow-Origin': '*',
'contentType': "application/atom+xml",
'GData-Version': '2',
'X-GData-Key': 'key=' + dev_Key },
success : function(response) {
},
error : function() {
alert("Delete of playlist failed."); }
}
);
这是来自 Chrome-Tools 的反馈,表明该请求作为 OPTIONS 请求和更多信息发送:http: //imgur.com/2UvIz,FQW75#0
在 javascript 控制台中,我收到以下错误: OPTIONS https://gdata.youtube.com/feeds/api/users/default/playlists/760354511254461C?access_token=ya29.AHES6ZS51Dqs8F8CwkWq23LgevXCD7tWSJLVCLEBxEW22a2zNSY8OCxr 405 (Method Not Allowed) XMLHttpRequest 无法加载https://gdata.youtube.com/feeds/api/users/default/playlists/760354511254461C?access_token=ya29.AHES6ZS51Dqs8F8CwkWq23LgevXCD7tWSJLVCLEBxEW22a2zNSY8OCxr。Access-Control-Allow-Origin 不允许来源http://localhost:3000 。