How do I debug why MVC is returning 500 error when I try to post to my controller from AngularJS? No exceptions are thrown.
Here is my AngularJS code
var recordingRequest = {
deviceSerial: 2160563840,
plannedStartTime: "2015-08-07T14:29",
recordingDuration: 60,
recordingDurationIsMinutes: true
}
The service that posts the data:
deviceAPI.addDeviceRecording = function (recordingRequest) {
// Request data
return $http.post("/devices/adddevicerecording/", recordingRequest);
}
And finally the MVC controller entry point:
[HttpPost]
public ActionResult AddDeviceRecording(int deviceSerial, string plannedStartTime, int recordingDuration, bool recordingDurationIsMinutes)
{
}
Any breakpoints I put inside the AddDeviceRecording function never gets hit. I know its getting part way there because it gives 500 rather than 404. If I change the $http.post to point to a random URL I get 404 instead.