Skip to content

Instantly share code, notes, and snippets.

@thebapi
Created February 7, 2014 19:19
Show Gist options
  • Save thebapi/8869846 to your computer and use it in GitHub Desktop.
Save thebapi/8869846 to your computer and use it in GitHub Desktop.
function postData() {
$.ajax("/services/users/login", {
type: "POST",
cache:false,
dataType: 'json',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({ userName : 'thebapi@gmail.com'}),
success: function (msg) {
alert(msg);
},
error: function (resp){
var responseObj = JSON.parse(resp.responseText);
responseObj.message && alert( responseObj.message );
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment