1

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..?

2
  • 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 Commented Sep 29, 2014 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/… Commented Sep 29, 2014 at 12:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.