I have a controller method as below.
public class ProcessorController : System.Web.Http.ApiController
{
[HttpPost]
public void Paid(string confirmationNumber)
{
}
}
I am trying to call this method from a function in angular js as below. The $http.post is not working. I see an error 'The resource cannot be found' in fiddler when it is trying to hit the path that is specified in $http.post. Can anyone please point out what is going wrong here? Thank you!
var payControllers = angular.module('payControllers', []);
payControllers.controller('payCtrl', ['$scope', '$http',
function ($scope, $http) {
$scope.Process = function(confnumber) {
$scope.ConfNumber = confnumber;
if ($scope.ConfNumber.length > 0) {
$http.post('/Processor/Paid',
{
confirmationNumber: $scope.ConfNumber
}
).success(function () {
alert('updated')
});
}
}
}]);