A web service based on REST is called a RESTful web service REST is not

A web service based on rest is called a restful web

This preview shows page 12 - 18 out of 23 pages.

A web service based on REST is called a RESTful web service. REST is not dependent on any protocol, but almost every RESTful service uses HTTP as its underlying protocol.
Image of page 12
Resources and Representations Any information that can be named can be a resource: a document, an image, a temporal service, a real life thing such as a customer, a collection of other resources, etc. The state of resource at any particular time (e.g., at the time of the request) is known as resource representation . A representation consists of data, metadata describing the data and hypermedia links which can help the clients in transition to next desired state. A representation should be able to completely represent a resource. If there is a need to partially represent a resource, then you should think about breaking this resource into child resources. REST does not impose any restriction on the format of a resource representation. Could be using JSON, XML or HTML.
Image of page 13
REST Architecture Constraints An application or architecture considered RESTful or REST-style has the following characteristics: Uniform Interface Client-Server Separation Be stateless Cacheable Layered
Image of page 14
Uniform Interface A RESTful service uses a directory structure-like URIs to address its resources. <protocol>://<service-name>/<ResourceType>/<ResourceID> Another important attribute of a request is VERB which identifies the operation to be performed on the resource. REST asks developers to use HTTP methods explicitly and in a way that's consistent with the HTTP protocol. This basic REST design principle establishes a one-to-one mapping between create, read, update, and delete (CRUD) operations and HTTP methods. To create a resource on the server, use POST. To retrieve a resource, use GET. To change the state of a resource or to update it, use PUT. To remove or delete a resource, use DELETE.
Image of page 15
Client-Server Separation The client and the server act independently, each on its own, and the interaction between them is only in the form of client-server request-response interaction . The server just sits there waiting for requests from the client to come.
Image of page 16
Be Stateless Stateless means the server does not remember anything about the client. Each individual request contains all the information the server needs to perform the request and return a response, regardless of other requests made by the same user before. No client context shall be stored on the server between requests. The client is responsible for managing the state of the application.
Image of page 17
Image of page 18

You've reached the end of your free preview.

Want to read all 23 pages?

  • Summer '19
  • Web Services, Representational State Transfer, Hypertext Transfer Protocol

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture