i'm trying to send to a ws a post request using some parameters.
in Ajax i do:
$.post("http://myWS",{name:"xxx",surname:"yyy"},function(response){
console.log(response);
});
this generate that payload:
{name:"xx",surname:"yyy"}
In AngularJS i do:
return $http({
method: 'POST',
async : true,
cache : false,
url: "http://myWS",
data: {name:"xxx",surname:"yyy"},
});
And this generates that paylaod:
{"name":"xxx","surname":"yyy"}
As you can see this payload differs from ajax one.
I tried to add header to $http request:
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
but results is the same.
what could be the problem?? thanks!