November 2017
Intermediate to advanced
420 pages
10h 29m
English
The PUT method is used to update resources. To update a resource, we first need its representation in the client. Then, at the client level, we update the resource with the new value(s) that we want. Finally, we update the resource by using a PUT request together with the representation as its payload.
In this example, let's add a manager to the Sales department, which we created in the previous example.
Our original representation of the Sales department is as follows:
{"departmentId":40,"departmentName":"Sales","manager":"Tony Greig" }
Let's update the manager for the Sales department; our representation is as follows:
{"departmentId":40,"departmentName":"Sales","manager":"Ki Gee"}
We are now ready to connect to our ...