here is my array in controller:
$scope.arr = [];
$scope.arr.push({
QuestionId1: firstQuestionId,
QuestionId2: secondQuestionId,
SecurityAnswer1: firstQuestionAnswer,
SecurityAnswer2: secondQuestionAnswer
});
AccountService.SubmitSecurityAnswer($scope);
then here is my api in angular service:
fact.SubmitSecurityAnswer = function (d) {
debugger;
return $http({
method: 'POST',
url: API_RESOURCES.API_Domain + 'api/Account/SaveSecurityAnswers',
headers: { 'content-Type': 'application/x-www-form-urlencoded' },
transformRequest: function (obj) {
var str = [];
for (var p in obj)
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
return str.join("&");
},
isArray: true,
data: d.arr
}).success(function (response) {
return response;
The C# function which this api calls is:
public HttpResponseMessage SaveSecurityAnswers(List<SecurityQuestion_CustomerMap> obj)
{
When I check 'obj' through break point it shows count=0..I think the format of 'data: d.arr' is not right or is it? Please help.