【发布时间】:2014-12-16 23:24:56
【问题描述】:
我有一个 MVC 动作,它需要一个 int 数组(int[] ids)。我正在使用 angularjs 的 $http 帖子,但每次我发布它都会返回一个 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) {});
我试过这个解决方案
AngularJs $http.post() does not send data
但是如果我注入 $httpProvider 会引发注入错误。我正在使用 angularjs 1.3
【问题讨论】:
标签: asp.net-mvc angularjs angularjs-service