Search code examples
node.jsangularjsrestangular

Set content type in restangular for put request globally


I am using nodejs server and restangular(angular framework) to build a RESTfull API.

When I make a POST request, the form data is sent in request payload(body).

But when I make a PUT request, the form data is appended to the URL as a query string.

How can I configure restangular to send form data inside body similar to POST request?


Solution

  • Use customPUT() instead of put().

    baseObj.customPUT(newObj).then(callbackFunction);