printchomp test
by ghinda
JavaScript
var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://sandbox.printchomp.com/oauth/token');
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onreadystatechange = function () {
if (this.readyState == 4) {
if (typeof cb !== "undefined") {
cb(this);
}
else {
alert('Status: '+this.status+'\nHeaders: '+JSON.stringify(this.getAllResponseHeaders())+'\nBody: '+this.responseText);
}
}
};
xhr.send("{\n \"grant_type\": \"client_credentials\",\n \"client_id\": \"8406710cb5a45e807f1dedaa3f915b5d6559431f72e844ba4258b38ddfc7c2a3\",\n \"client_secret\": \"dadbdf03ab77c3a1cd411798de4db09298b38b3c360483a76f1c57b561125e0d\"\n}");