Examples of using $ http.put in Angular?

Are there any simple examples of using a method $http.put

in Angular? In particular, I'm not sure what the parameter should be data/Request content

, should it be an object or a property of an object?

$http.put(url, data, [config]);

      

+3


source to share


2 answers


The second parameter must be an object:



$http.put('/api/v1/users/' + user.login, { login: "login", password: "password" }); 

      

+5


source


I am using $ http.put like this in my project.



$http.put(api/resources/:id, {name:name});

      

+1


source







All Articles