user1247792
user1247792

Reputation: 11

Post comment to YouTube video using JavaScript

So I went to the YouTube API documentation (documentation link) and got the following:


    POST /feeds/api/videos/VIDEO_ID/comments HTTP/1.1
    Host: gdata.youtube.com
    Content-Type: application/atom+xml
    Content-Length: CONTENT_LENGTH
    Authorization: AuthSub token="AUTHORIZATION_TOKEN"
    GData-Version: 2
    X-GData-Key: key=DEVELOPER_KEY

And then some sample XML file.

Now my question is how do I actually do this? I have the developer key, token, etc. I just need to know how to put everything together and send. Please help.

TIA, S

Upvotes: 1

Views: 1894

Answers (1)

the_ghost
the_ghost

Reputation: 101

You should ask user to select some file from his computer at first and then just call ajax() with data from your form. If you need custom headers you can do it - http://api.jquery.com/jQuery.ajax/

You should use ajax because I don't know if you can control request headers while general form submit event when page reloads.

Upvotes: 1

Related Questions