HTTP Delete does not accept data as an argument.
Won't Work
Otherwise, I would pass an object like so:
var cdata = {
id: 2,
lineUp: [...]
};
// won't work
$http.delete('webapi/Data/delete, cdata)
.then(function(response) {
console.log(response);
})
.then(function(error) {
console.log(error);
});
If you wanted to be truly RESTful, you shouldn't need to pass anything to the HTTP Delete method besides the id.
RESTFul
var cdata = {
id: 2,
lineUp: [...]
};
// RESTful
$http.delete('webapi/Data/delete/' + cdata.id)
.then(function(response) {
console.log(response);
})
.then(function(error) {
console.log(error);
});
You can, however, use HTTP Post as a workaround.
Workaround
var cdata = {
id: 2,
lineUp: [...]
};
// workaround
$http.post('webapi/Data/delete, cdata)
.then(function(response) {
console.log(response);
})
.then(function(error) {
console.log(error);
});