質問

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