I don't know but this seems ambiguous to me. I'm trying to make a DELETE request, applied on multiple objects, referenced with their IDs (the ones in the array).
This is my controller :
[HttpDelete]
public void RemoveRoomWithDevices([FromUri]int roomId, [FromBody] int[] userDevicesId)
{ //code
}
This is the JS :
function DeleteRoomWithDevices(RoomID, FloorId, userDevicesID) {
$.ajax({
url: "/api/Room/RemoveRoomWithDevices?RoomId=" + RoomID,
type: "DELETE",
dataType: 'json',
contentType: 'application/json',
data: {
userDevicesId: userDevicesID
},
traditional: true,
success: function (data) {//success}
});
Here, in the POST column, the array is not passed (I'm debugging with firebug). When I replace the type with type: "POST"
I am able to see the array but I can't execute the delete query.
What do you suggest?