February 2018
Intermediate to advanced
246 pages
6h 3m
English
We will use PUT in our REST API to update a specific resource type. PUT defined in our API is stringent with accepting the payload without complete data, that is, it will reject with incomplete payloads.
In this example, we will modify the newly created book "3" and change its link to point at "http://link-to-book-15.com":
// Request
PUT "<URL>/api/books/3"
// payload
{
"title": "book5",
"link": "http://link-to-book-15.com"
}
// response
{
"id": "3",
"title": "book5",
"link": "http://link-to-book-15.com"
}
Read now
Unlock full access