Skip to content

ApiKey Authorization

amccloud edited this page Jun 1, 2012 · 2 revisions
var authorize = function(username, key) {
    jQuery.ajaxSetup({
        beforeSend: function(xhr) {
            xhr.setRequestHeader('Authorization', 'ApiKey ' + username + ':' + key);
            return xhr;
        }
    });
};

authorize('username', 'key');

authorize only needs to be called once. All subsequent ajax request will then be properly authorized.

Clone this wiki locally