I have an MVC action that expects an array of int (int[] ids). I'm using $http post of angularjs but everytime I post it would return a null
$http({
method: 'POST',
url: url,
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8;' },
data: $.param({
pcode: $scope.pcode,
bId: $scope.bId,
brandIds: [898,55],
regId: $scope.regId,
__RequestVerificationToken: getVerificationToken() // this is Html.Antiforgery that the action needs for posts
})
}).success(function (result) {});
I tried this solution
AngularJs $http.post() does not send data
but it's throwing an injection error if i inject the $httpProvider. I'm using angularjs 1.3