RESTful Web Services

Intro

Representational state transfer (REST) is a style of software design architecture.

RESTful Constraints

In order to be RESTful, the architecture must comply to the following contraints.

  1. Client-server:
    • Separation of concerns into client and server (loose coupling):
      • Client focuses on UI
      • Server not concerned about UI
  2. Stateless:
    • No client context is stored on the server between requests.
    • All session state is stored in client.
    • Server can be stateful, but every server side state need to be addressable by URL as a resource.
  3. Cacheable:
    • All responses must indicate to client if they are cacheable.
  4. Layered system:
    • Client does not know about the end server (Allow intermediary servers)
  5. Code on demand (optional):
    • Servers can temporarily extend or customize the functionality of a client by transferring logic (e.g. JavaScript) to the client.
  6. Uniform interface
    • Uniform interface decouples client and server to achieve separation of concerns.

RESTful Web Services

RESTful web servies implement web services:

  • Using HTTP
  • Compliant with RESTful constraints.

A RESTful web service must define:

  1. Base URI (e.g. http://example.com/resources).
  2. Supported data type (e.g. JSON, XML).
  3. Supported operations using HTTP methods (e.g. GET, PUT, POST, or DELETE).
  4. API that is hypertext driven.

References

 

 

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.