Are there any simple examples of using the $http.put
method in Angular? Specifically, I'm unsure about what the data/Request content
parameter should be, should it be an object or an object property?
$http.put(url, data, [config]);
Are there any simple examples of using the $http.put
method in Angular? Specifically, I'm unsure about what the data/Request content
parameter should be, should it be an object or an object property?
$http.put(url, data, [config]);
Share
edited Nov 28, 2017 at 10:12
Phonolog
6,5213 gold badges39 silver badges64 bronze badges
asked Jun 18, 2015 at 11:17
Jorge BushJorge Bush
711 silver badge6 bronze badges
2
- 1 $http.put method is used for updating the data in the server. i.e., If you are having students' records, then using their ID, you can edit (or) update the data. '$http.put('Some-api/students/'+stuId+'/'+data); – Virtual Realist Commented Jun 18, 2015 at 11:28
- @VirtualRealist in your example, what is "+data"? I'm trying to understand how to write params in the path of the http.put request. Thanks. – Chris22 Commented May 21, 2019 at 16:29
2 Answers
Reset to default 5Second parameter must be an object:
$http.put('/api/v1/users/' + user.login, { login: "login", password: "password" });
I use $http.put like this in my project.
$http.put(api/resources/:id, {name:name});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742294927a4416923.html
评论列表(0条)