When using $resource with POST method (the item i want to delete on the server is of type "Todo") My java SpringREST back controller looks like :
/**
 * POST : delete an todo : /todos/DEL
 */
@RequestMapping(value = "/DEL", method = RequestMethod.POST)
public void deletePOST(@RequestBody Todo todo) {
    todoRepository.delete(todo);
}
Angular code :
 vm.deleteTodoRes2 = function deleteTodoRes2(todo) {
                console.log(todo);
                var url = REST_SERVER_URL + "/todos/DEL";
                var urlParamDefaults = {};
                var action = {
                    removeResource: {
                        method: 'POST',
                        headers: {
                            'Content-Type': 'application/json'
                        },
                        isArray: false,
                        transformRequest : function(data, headers) {
                            console.log("data");
                            console.log(data);
                            var out = angular.toJson(data);
                            console.log("out ");
                            console.log(out);
                            return  out;
                        }
                    }
                };
                var rest = $resource(url, urlParamDefaults, action);
                // API : rest.<method> ( [param],
                //                       if NON GET [entityData],
                //                      [success(value, responseHeaders)], [error(httpResponse)] )
                var param = {};
                rest.removeResource(param, todo,  successCallback, errorCallback);
            };
It works perfectlt with POST, Now if i try changing the http method from POST to DELETE, it does not work anymore.
Spring :
 @RequestMapping(value = "/DEL", method = RequestMethod.DELETE)  <<< only change in JAVA
In JS
var action = {  removeResource: { method: 'DELETE ', <<< only change in JS
It does NOT WORK , the console.log(data); => undefined It seems the Angular does NOT want to take my "toto" data and serialize it in json, why ?
