Can you help me troubleshoot why I am getting a 500 error in MVC when attempting to post to my controller from AngularJS? There are no exceptions being thrown.
Below is the AngularJS code I am using:
var recordingRequest = {
deviceSerial: 2160563840,
plannedStartTime: "2015-08-07T14:29",
recordingDuration: 60,
recordingDurationIsMinutes: true
}
The service responsible for posting the data is shown below:
deviceAPI.addDeviceRecording = function (recordingRequest) {
// Request data
return $http.post("/devices/adddevicerecording/", recordingRequest);
}
Lastly, here is the entry point of the MVC controller:
[HttpPost]
public ActionResult AddDeviceRecording(int deviceSerial, string plannedStartTime, int recordingDuration, bool recordingDurationIsMinutes)
{
}
I have tried setting breakpoints inside the AddDeviceRecording
function but they are never reached. However, I can confirm it is partially working as it returns a 500 error instead of a 404. If I change the $http.post
to an incorrect URL, a 404 error is returned instead.