HATEOS provide by server or client?
This is my first contact with HATEOS. I make a frontside client application which has to be connected with server using this format. I saw a JSON pattern with all hyperlinks refers to related objects. My question is should I created those hyperlinks from client side app or this is the task for the server?
Links are generated on the server side. You must distinguish between application state, and the state of a resource on a server. Clients handle application state. Servers handle resource state. An application state determines “where” the client is in the process of completing a task, i.e.: where it is in its interaction with the server. A resource state is the kind of persistent data a server stores, and lasts beyond the duration of a single session of interactions. Along with the representation of a resource itself, comes some metadata (the “links” section in the JSON representation) telling the client what can be done next with that resource. To actually alter the resource state, the client has to follow one of the provided links, generated by the server. Let’s take a concrete example that illustrates these concepts. If you are browsing through a thumbnail gallery and the server has just sent you thumbnail number 23, your client cannot simply say “next” to the server, because this would imply that the server has to remember that your client application had asked for number 23 previously. And it would have to keep that “context” for each connected client. If instead, the client explicitly asks for thumbnail number 24 to advance in the gallery, the server is relieved from that burden: between two successive calls to your thumbnail service, the server hasn’t to remember anything. The “context” (i.e. the relevant part of application’s state) is kept on the client and explicitly passed to the server. The good thing is that you don’t necessarily have to know either that you were viewing that specific thumbnail in the previous call. Because, along with the representation of this image, the server can send you links labeled “previous” and “next” leading to the corresponding thumbnails. At the time the server was generating the representation of thumbnail 23, the server had all information related to your request. It knew what thumbnail you requested, and what the previous and next ones were. It can therefore generate the corresponding links in the HATEOAS representation.
How is this nil key into the hash?
How to avoid duplicate entries in mongoose
How to evaluate a value as a variable in row returned by neo4j?
WSO2 ESB Custom Axis Module JSON Payload in MessageContext
Android - How can I access nested objects?
Json deserialization of Scala case objects with spray-json
What database model should be used with a bunch of different items?
JSON Property not binding to JSON.NET PropertyName in ASP.NET MVC 5 Post request
How to use Newtonsoft.Json as default in Asp.net Core Web Api?
Get product details in JSON format using REST API
Extract value from JSON
Get JSON stringify value
Express: Prevent bodyParser from parsing request
Nested arrays in json vs multiple separated json objects - performance