Manipulation of Resources through Representations Self-descriptive Messages

6 Copyright © 2016 Open Geospatial Consortium.

5.1.6 Manipulation of Resources through Representations

The resources themselves are conceptual as far as the client is concerned and any of a number of representations are what is actually exchanged with clients. For example, a server does not send its database, but rather, a HTML, XML or JSON document that encodes requested database records. Such documents may be expressed, for instance, in French and encoded in UTF-8, depending what the client requests and the server can provide. When a client holds a representation of a resource, including any metadata attached, it has enough information to modify or delete the resource on the server, provided it has permission to do so.

5.1.7 Self-descriptive Messages

Each representation message returned by a server is supposed to include enough information that a client is able to determine how to process the message without out-of- band code or information that is specific to that representation. An existing parser may be invoked, for example, by an Internet media type previously known as a MIME type. While this is a valuable constraint for a resilient Web, the general effectiveness of media types in providing guidance for client processing has been somewhat overwhelmed by the variety of message types that have developed. Typically, a client application requires specialized code to deal with specialized media types or the ways in which specific representations may differ from general media types. This code is either built in based on out-of-band knowledge or it comes along with the response. Even HTML as a general media type is frequently supplemented by javascript code for specific application processing. A notable form of self-descriptive message is, of course, hypermedia, in which various information media text, pictures, videos, …maps support application navigation by way of links. Where the processor of the document is a human or the document is highly structured and application flow consists of choosing the link to follow next, this type of self-descriptive message can be very effective. Self-description also applies to responses explicitly indicating their cache-ability.

5.1.8 Hypermedia as the Engine of Application State HATEOAS