2

Below is quoted from Fielding's REST dissertation 6.4.3.2 Cookies

Likewise, the use of cookies to identify a user-specific “shopping basket” within a server-side database could be more efficiently implemented by defining the semantics of shopping items within the hypermedia data formats, allowing the user agent to select and store those items within their own client-side shopping basket, complete with a URI to be used for check-out when the client is ready to purchase.

For the bold part, does it mean to store the items in the page? Such as hidden elements of a form? If so, I think customer will lose his purchase when he leaves the page.

So what exactly does the hypermedia data formats mean?

smwikipedia
  • 61,609
  • 92
  • 309
  • 482
  • The context makes it sound like for example the JSON structure. Define the semantics of the shopping cart withing the JSON structure, store the data in the client side (Javascript) data structures until checkout, then sent the shopping cart data in the JSON to server. That's how I interpret it. – Paul Samsotha Dec 19 '15 at 16:47
  • @peeskillet If store the data on the client JS data structures, how to maintain it across different pages? – smwikipedia Dec 19 '15 at 23:52
  • That's just my interpretation, it is not a complete shopping basket solution :-). How else would you interpret _"client-side shopping basket"_? – Paul Samsotha Dec 20 '15 at 02:10

1 Answers1

0

What it is talking about is what format the data being transferred is so the client knows how to read it and what to do with it. So with HTML, the format would be "text/html" and with mp4 audio it would be "audio/mp4".

Without such indications when the data is sent by the server, the client has no way of knowing for sure how to interpret the data being sent.

While the data can be defined and interpreted using other methods, hypermedia data formats are part of the HTTP standard and well defined, not requiring any outside helpers.

Rob
  • 14,746
  • 28
  • 47
  • 65