diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 4cee239f891c..0ad0f19bfcf4 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -161,6 +161,8 @@ function shallowClearAndCopy(src, dst) { * - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods - * `response` and `responseError`. Both `response` and `responseError` interceptors get called * with `http response` object. See {@link ng.$http $http interceptors}. + * - **`hasBody`** - `{boolean}` - allows to specify if a request body is to be used (not + * required for POST,PUT,PATCH and can't disable body inclusion on this methods). * * @param {Object} options Hash with custom settings that should extend the * default `$resourceProvider` behavior. The only supported option is @@ -511,7 +513,7 @@ angular.module('ngResource', ['ng']). }; forEach(actions, function(action, name) { - var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method); + var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method) || action.hasBody === true; Resource[name] = function(a1, a2, a3, a4) { var params = {}, data, success, error;