In my client app—written in javascript and jQuery—I have a function where I'm doing $.ajax request with the DELETE method to my server.
The code is something like this:
this.delete_one = function(id){
console.log(id);
$.ajax({
url: sitesCtrl.url,
type: "delete",
dataType: 'json',
data: {"id": id},
success: function(data){
if (data.success){
$("sitesList").remove("#" + id + "\"");
}
else{
console.log(data.message);
}
},
error: function(){
console.log("internal error");
}
})
};
The problem is that the server gets the request with no parameter "id"! Just a simple DELETE (according to firebug). with PUT, POST, or GET it works great.