Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

The Restangular.remove() function sends the request object as query params(EXAMPLE: /users?ids=1&ids=2&ids=3) instead of send these ids as a body params(JSON format)

Example Code:

$scope.users = {};
$scope.myIds = ['1','2','3'];
$scope.users.ids = $scope.myIds;
var baseUsers = Restangular.all('users');
baseUsers.remove($scope.users).then(function(data){
console.log("Rsp Data :", data);
};

How to sending this array of ids $scope.users as a request body..?

share|improve this question
    
have you tried the custom methods from [link]ng-newsletter.com/posts/restangular.html, author.customPOST({body: "Ari's Bio"}, // post body "biography", // route {}, // custom params {}); // custom headers –  Stefanos Chrs Sep 29 at 12:35
    
HTTP DELETE requests normally don't have a request body. DELETE requests normally come in the form of DELETE /user/5 or with a batch of deletes something like this: stackoverflow.com/questions/511281/… –  Rohan Sep 29 at 12:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.