Handling HTTP PUT
When we use the HTTP PUT , we are asking our service to update a given resource, and we will do it in the form of /customer/id.This specifies which resource needs to be updated among all of them. But we need to send a customer as JSON body as well so we get exactly what we need to update. In RESTful APIs, the concept is that resources are held in the client and updated back to the server when required. Then, this object represents a state of the object which was queried.
But before implementation, we may need to consider one thing. What happens if the resource that we request to update changes the id, is it a valid scenario? It depends on how we have defined our API to work, and it could be actually something that we like ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access