©2009 Google -
Code Home -
Terms of Service -
Privacy Policy -
Site Directory
Google Code offered in:
English -
Español -
日本語 -
한국어 -
Português -
Pусский -
中文(简体) -
中文(繁體)
The Interactive API Demo is written in JavaScript. The HTTP requests and responses that appear when you run the demo provide good examples of the requests and responses your application needs to handle.
You can run the Interactive API Demo directly from this site. It is fairly self-explanatory.
The primary implementation files are demo.js and httpRequest.js.
The following function constructs a Request header, including the AuthSub token and the developer key.
function constructRequestHeaders(token) {
var headers = new Array();
headers["Content-Type"] = "application/atom+xml";
headers["Authorization"] = 'AuthSub token="' + token + '"';
headers["X-Google-Key"] = 'key=ABQIAAAA7VerLsOcLuBYXR7vZI2NjhTRERdeAiwZ9EeJWta3L_JZVS0bOBRIFbhTrQjhHE52fqjZvfabYYyn6A';
return headers;
}