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

Sasi
  • 188
  • 1
  • 13
  • have you tried the custom methods from [link]http://www.ng-newsletter.com/posts/restangular.html, author.customPOST({body: "Ari's Bio"}, // post body "biography", // route {}, // custom params {}); // custom headers – Stefanos Chrs Sep 29 '14 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: http://stackoverflow.com/questions/511281/patterns-for-handling-batch-operations-in-rest-web-services – Rohan Sep 29 '14 at 12:35

0 Answers0