سؤال

I want to send data to youtube by POST method. I write http.open("POST", myUrl, true); in the code as following

var myUrl = "https://gdata.youtube.com/action/GetUploadToken";
 http.open("POST", myUrl, true);
            http.setRequestHeader("Authorization", "AuthSub token=" + code);
            http.setRequestHeader("GData-Version", 2);
            http.setRequestHeader("X-GData-Key", "key="+dev_key);
            http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

but the error is

Request URL:https://gdata.youtube.com/action/GetUploadToken
Request Method:OPTIONS
Status Code:405 Method Not Allowed

Kindly tell me what is the wrong here

هل كانت مفيدة؟

المحلول

AJAX doesn't allow you to send request to domains other than that which hosts the code?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top