Monday 25 June 2012

REST Interaction, Protocol Servlets & Example


A REST interaction generally includes following elements:
  • Operation— It belongs to a restricted, well-known set of operations—for example, in the HTTP protocol, the main operations are GET, POST, PUT, and DELETE. The operations are all known in advance hence no need arises to define interfaces for a RESTful protocol. In this regard, REST architecture is advantageous as compared to RPC architectures.

  • URI— It identifies the resource that the operation acts on. For example, a HTTP GET operation acts on the URI by fetching data from the resource identified by the URI.

  • Data (Optional)— It is required for operations that send data to the remote resource.


REST Protocol Servlets

The REST protocol is implemented by the following servlets running in a Web container:
  • message servlet— It supports the sending and consuming of messages.
  • queueBrowse servlet—It enables us to monitor the contents and view the current status of a particular queue. It is an effective and simple management tool.

RESTful Example

The World Wide Web is a major example of RESTful design and conforms to REST principles to a large extent. The Web consists of the Hypertext Transfer Protocol (HTTP), content types including the Hypertext Markup Language (HTML), and other Internet technologies such as the Domain Name System (DNS).
  • HTML can include JavaScript and applets to support code on demand, and has implicit support for hyperlinks.
  • HTTP has a uniform interface for accessing resources, which consists of URIs, methods, status codes, headers, and content distinguished by MIME type.

No comments:

Post a Comment