My favorites | English | Sign in

YouTube APIs and Tools

YouTube logo

Developer's Guide: Data API Protocol – Authenticating Requests from Flash Applications

As shown in the examples throughout this documentation, different API operations are executed using either HTTP GET, POST, PUT or DELETE requests. However, Flash applications must send an HTTP POST request in order to set an Authorization header.

To submit an authenticated HTTP GET, PUT or DELETE request from a Flash application, set the X-HTTP-Method-Override header in the request to either GET, PUT or DELETE. If your application is submitting a GET request, it should set the body of the request to the query parameters associated with that request as shown in the following example:

POST /feeds/api/videos HTTP/1.1
X-HTTP-Method-Override: GET
Host: gdata.youtube.com
Content-Type: application/atom+xml
Content-Length: CONTENT_LENGTH
Authorization: AuthSub token="<authentication_token>"
GData-Version: 2
X-GData-Client: <CLIENT_ID>
X-GData-Key: key=<DEVELOPER_KEY>

vq=jesse+ventura&category=News

If your application is submitting a POST or PUT request, it should set the body of the request to an XML document. The XML formats for different types of requests are defined in later sections of this documentation.