Saturday, March 27, 2010

What are RESTful Web Services?

A paper that expands on the basic principles of REST technology can be found at:

http://www2008.org/papers/pdf/p805-pautassoA.pdf

The REST architectural style is based on four principles:

Resource identification through URI.

A RESTful Web service exposes a set of resources which identify the targets of the interac- tion with its clients. Resources are identified by URIs [5], which provide a global addressing space for resource and service discov- ery.

Uniform interface.

Resources are manipulated using a fixed set of four create, read, update, delete operations: PUT, GET, POST, and DELETE. PUT creates a new resource, which can be then de- leted using DELETE. GET retrieves the current state of a resource in some representation. POST transfers a new state onto a resource.

Self-descriptive messages.

Resources are decoupled from their representation so that their content can be accessed in a variety of formats (e.g., HTML, XML, plain text, PDF, JPEG, etc.). Meta- data about the resource is available and used, for example, to con- trol caching, detect transmission errors, negotiate the appropriate representation format, and perform authentication or access con- trol.

Stateful interactions through hyperlinks.

Every interaction with a resource is stateless, i.e., request messages are self-contained. Stateful interactions are based on the concept of explicit state trans- fer. Several techniques exist to exchange state, e.g., URI rewriting, cookies, and hidden form fields. State can be embedded in response messages to point to valid future states of the interaction.

No comments:

Post a Comment