Skip to content

Instantly share code, notes, and snippets.

@kraft001
Created November 21, 2011 10:52
Show Gist options
  • Save kraft001/1382300 to your computer and use it in GitHub Desktop.
Save kraft001/1382300 to your computer and use it in GitHub Desktop.
Test RESTful API through Firebug console (post queries)
var http = new XMLHttpRequest();
http.open("POST", "http://gsb.rf/api2/sessions");
var params = "args=type:card,login:123,password:345";
http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.onreadystatechange = function() {
if (http.readyState == 4 && http.status == 200) {
console.info(http.responseText);
}
};
http.send(params);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment