REST API

Kulakshi Fernando
2 min readJun 21, 2020

--

  1. What is REST stands for?

REpresentational State Transfer

2. What is REST?

A software architecture for implementing Web Service API. (A web service API that conforms to REST is a RESTfull web service)

3. What is the REST Architecture?

REST architecture has 6 architectural constraints.

Client-Server Architecture (Implements separation of control)

Statelessness (No client state such as session are stored in the server)

Cacheability (Responses can be cacheable on client or intermediaries if chose to be so)

Layered System (Can add layers in between client and server without changing server/client code)

Code on Demand (optional. Servers can response with executable code extending its functionality to the client temporarily)

Uniform Interface

4. What are the constraints of the uniform interface

Resource Identification in a request (Eash resource in the server can be identified with a unique identifier (URI — Universal Resource Identifier))

Resource manipulation through representations (When client has a representation of resources in the server he/she has enough information to manipulate (edit/delete) the resource)

Self-descriptive messages (messages between client and server should be self-descriptive. For example, in case there is a media file, the media type can be added, so that the client/server knows how to read it)

Hypermedia As The Engine Of Application State (HATEOAS — Client should be able to access server resources dynamically in the application without hardcoding them. This can be achieved by providing hyperlinks in server responses)

5. What are the components of a Restful Web Service API

A base URI

Standard HTTP Method

Media type

6. What are HTTP methods?

POST

GET

PUT

PATCH

DELETE

--

--