Which is the right way to pass parameter in a DELETE in AngularJS?
This call is not working:
$http.delete("api/testDelete",
{
Id:5
}
).success(function (data) {
alert('Exit status ' + data);
});
This call is working:
$http.delete("api/testDelete",
{
{ params: { Id: 5 } }
}
).success(function (data) {
alert('Exit status ' + data);
});
This is the C# Web Api being called:
[HttpDelete]
public bool testDelete(int Id)
{ return true; }
Why do i have to use params? Is it possible to pass an object? Thanks