everything lives in the title.
when producing a resource in angular :
myModule.factory('MyResource', ['$resource', function ($resource) {
return $resource('api/MyResource/:id');
}]);
and using in a controller :
MyResource.save({att: att, att2: att2});
the Service sends the data in a json
artifact ahead to the server.
I need to send the data in a x-www-form-urlencoded
shape.
Where ought I modify my code to resolve that ?
Should pass the
headers
parametersthen serialize your data before sending them with
$httpParamSerializer
Complete answer (since angular 1.4). You need to include de dependency $httpParamSerializer
I finally found myself:
When defining a resource and the associated instruction, the "headers" parameter comes in hand.