Slide 17
Slide 17 text
Understanding HATEOAS
➡ Listing a book in the library
GET /book/9780345376596 HTTP/1.1
Host: library.org
Accept: application/json
..
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: …
{
"name": "the pale blue dot",
"ISBN": "9780345376596",
"author": "carl sagan",
"borrow": "http://library.org/book/9780345376596/borrow"
}
GET /book/9780345376596 HTTP/1.1
Host: library.org
Accept: application/json
..
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: …
{
"name": "the pale blue dot",
"ISBN": "9780345376596",
"author": "carl sagan",
"return": "http://library.org/book/9780345376596/return"
}
➡ Listing a book after its been
borrowed