Skip to content Skip to sidebar Skip to footer

Restangular - PUT Request Payload Is Being Sent As Query String Parameters

I'm using rectangular and have something like this: stuffResource = parentResource .one(resources.category, $scope.stuff.category) .one(resources.stuff, $scope.

Solution 1:

What you want to do here is use customPUT() instead of the normal put().

stuffResource = parentResource
    .one(resources.category, $scope.stuff.category)
    .one(resources.stuff, $scope.stuff.id)
    .customPUT($scope.stuff);

From the docs

  • put([queryParams, headers]): Does a put to the current element

  • customPUT([elem, path, params, headers]): Does a PUT to the specific path. Optionally you can set params and headers and elem. Elem is the element to post. If it's not set, it's assumed that it's the element itself from which you're calling this function.


Post a Comment for "Restangular - PUT Request Payload Is Being Sent As Query String Parameters"