Send Request Body on $resource Send Request Body on $resource angularjs angularjs

Send Request Body on $resource


Building on @gargc's answer, you can pass parameters and a body to a resource's method:

myResource.save({ param: myParam }, myObject);


As long as the action supports a body message (e.g. POST, but not GET), you can pass a data parameter to the action method of your resource, which will be sent in the body of the request:

yourResource.save(yourData)

Example: http://jsfiddle.net/N3NXK/1/