Add parameters to query string when using PUT method with Angular's $http
With $http.put
, $http.post
or $http.patch
, the config object containing your url parameters goes as the third argument, the second argument being the request body:
$http.put("/api/test", // 1. url
{}, // 2. request body
{ params: { heroId: 123, power : "Death ray" } } // 3. config object
);
$http.put
documentation for reference