This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,8 @@ function shallowClearAndCopy(src, dst) {
161
161
* - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -
162
162
* `response` and `responseError`. Both `response` and `responseError` interceptors get called
163
163
* with `http response` object. See {@link ng.$http $http interceptors}.
164
+ * - **`hasBody`** - `{boolean}` - allows to specify if a request body is to be used (not
165
+ * required for POST,PUT,PATCH and can't disable body inclusion on this methods).
164
166
*
165
167
* @param {Object } options Hash with custom settings that should extend the
166
168
* default `$resourceProvider` behavior. The only supported option is
@@ -511,7 +513,7 @@ angular.module('ngResource', ['ng']).
511
513
} ;
512
514
513
515
forEach ( actions , function ( action , name ) {
514
- var hasBody = / ^ ( P O S T | P U T | P A T C H ) $ / i. test ( action . method ) ;
516
+ var hasBody = / ^ ( P O S T | P U T | P A T C H ) $ / i. test ( action . method ) || action . hasBody === true ;
515
517
516
518
Resource [ name ] = function ( a1 , a2 , a3 , a4 ) {
517
519
var params = { } , data , success , error ;
You can’t perform that action at this time.
0 commit comments