Can anyone please help me find out why this piece of code works fine:
$.ajax({
type: "POST",
url: scope.serviceBase + "/api/Property/PostAsync",
contentType: "application/x-www-form-urlencoded",
processData: false,
data: data,
success: function (response) {
alert(response);
},
error: function (response) {
alert(response);
}
});
While exact same thing just using Angularjs fails:
$http({
method: "POST",
url: scope.serviceBase + 'api/Property/PostAsync',
headers: {
'processData':false,
'Content-Type': "application/x-www-form-urlencoded"
},
data: data
}).success(function (response) {
alert(response);
}).error(function (response) {
alert(response);
});
FYI, the error that I get using the AngularJs format is a 400 bad request.