Pergunta

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

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top