REST Flashcards
What does REST stand for?
REpresentational State Transfer
Who first introduced REST
Roy Fielding
What is REST?
Architectural style for distributed hypermedia.
What are the six constraints that must be satisfied for an interface to be RESTful?
- Uniform Interface
- Stateless
- Cacheable
- Client-Server
- Layered-System
- Code on Demand (optional)
What is the Uniform Interface constraint in REST?
The interface must be a uniform way of interacting with a given server irrespective of device or type of application (web, mobile, app).
What are the four guidelines of Uniform Interface in REST?
- Resource based.
- Manipulation of resources through representations.
- Self descriptive message.
- Hypermedia as the engine of application state (HATEOAS)
What is the Resource based guideline for the Uniform Interface constraint?
Individual resources are identified in requests (E.g. API/users).
What is the Manipulation of resources through representations guideline for the Uniform Interface constraint?
Client has representation of resource and and it contains enough information to modify or delete the resource on the server (E.g. client has user id).
What is the Self descriptive message guideline for the Uniform Interface constraint?
Each message has enough information to describe how to process the message so the server can easily process the request.
What is the Hypermedia as the engine of application state guideline for the Uniform Interface constraint?
If links need to be included in responses, clients can discover other resources easily.
What is the Stateless constraint in REST?
The necessary state to handle the request is contained within the request itself and server should not store anything related to the session.
What is a potential drawback of Stateless constraint
Can require more bandwidth as client must send more data with request.