|
36 | 36 | * @param {Object.<Object>=} actions Hash with declaration of custom action that should extend the
|
37 | 37 | * default set of resource actions. The declaration should be created in the following format:
|
38 | 38 | *
|
39 |
| - * {action1: {method:?, params:?, isArray:?, headers:?}, |
40 |
| - * action2: {method:?, params:?, isArray:?, headers:?}, |
| 39 | + * {action1: {method:?, params:?, isArray:?}, |
| 40 | + * action2: {method:?, params:?, isArray:?}, |
41 | 41 | * ...}
|
42 | 42 | *
|
43 | 43 | * Where:
|
|
49 | 49 | * - `params` – {object=} – Optional set of pre-bound parameters for this action.
|
50 | 50 | * - isArray – {boolean=} – If true then the returned object for this action is an array, see
|
51 | 51 | * `returns` section.
|
52 |
| - * - `headers` – {object=} – Optional HTTP headers to send |
53 | 52 | *
|
54 | 53 | * @returns {Object} A resource "class" object with methods for the default set of resource actions
|
55 | 54 | * optionally extended with custom `actions`. The default set contains these actions:
|
|
131 | 130 | * The object returned from this function execution is a resource "class" which has "static" method
|
132 | 131 | * for each action in the definition.
|
133 | 132 | *
|
134 |
| - * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and `headers`. |
| 133 | + * Calling these methods invoke `$http` on the `url` template with the given `method` and `params`. |
135 | 134 | * When the data is returned from the server then the object is an instance of the resource type and
|
136 | 135 | * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD
|
137 | 136 | * operations (create, read, update, delete) on server-side data.
|
@@ -370,8 +369,7 @@ angular.module('ngResource', ['ng']).
|
370 | 369 | $http({
|
371 | 370 | method: action.method,
|
372 | 371 | url: route.url(extend({}, extractParams(data, action.params || {}), params)),
|
373 |
| - data: data, |
374 |
| - headers: extend({}, action.headers || {}) |
| 372 | + data: data |
375 | 373 | }).then(function(response) {
|
376 | 374 | var data = response.data;
|
377 | 375 |
|
|
0 commit comments