I am trying to get my head around HATEOAS.
Let's work through an example. A client loads up a browser to getemails.com. To make it simple, let's assume that a call to getemails.com, hits the server and it returns back with a list of emails. Each email has a link that will the allow the user to get more details. Something like this:
{[
{
"id": "1",
"subject" : "subject something",
_links:[
"email":"http://getemails.com/emaildetail/1"
]
}
{
"id": "2",
"subject" : "subject something else",
_links:[
"email":"http://getemails.com/emaildetail/2"
]
}
]}
This is displayed to the user on a table. The user then clicks on a row, and the client code, will get the email url from under the _links of the selected row and make a call to the server. It will then update the page (assuming SPA) with the email details. It will also update the address to getemails.com/#email/1
Now what if the user bookmarks getemails.com/#email/1 location? Since the client app has not loaded the list of emails to begin with, how will it know that the url to call the server with to get more info is emaildetail/1?