Skip to content

Instantly share code, notes, and snippets.

@dasevilla
Created November 19, 2015 18:04
Show Gist options
  • Save dasevilla/9ea3cc332cdf906fce68 to your computer and use it in GitHub Desktop.
Save dasevilla/9ea3cc332cdf906fce68 to your computer and use it in GitHub Desktop.
var url = 'https://services.rdio.com/api/1/';
var oReq = new XMLHttpRequest();
oReq.onload = function(e) {
if(oReq.readyState === 4) {
if(oReq.status === 200) {
var response = JSON.parse(oReq.responseText);
console.info(response);
} else {
console.error(oReq);
}
}
};
oReq.onerror = function(e) {
console.log(oReq);
};
oReq.open('POST', url, true);
oReq.setRequestHeader('Authorization', 'Bearer ACCESS_TOKEN');
oReq.send('method=noop');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment