REST API
REST
• Acronym for REpresentational State Transfer.
• It is NOT A PROTOCOL
• It is an architectural style
• A Web API conforming to the REST architectural style is called a REST
API (or RESTful API).
Guiding Principles
• These provides simplicity, scalability and statelessness.
• The six guiding principles or constraints are:
Principles
1. Uniform Interface
Identification of resources – unique identity
Manipulation of resources through representations – uniform server
response representations, used to modify resource state in server
Self – descriptive messages – info. on message processing, additional
information’s
2. Client – Server
Separation of concerns of client & server.
Improves portability across platform
Improves scalability by simplifying server components
Make sure the client server interface doesn’t break
Principles
3. Stateless
Each client request must contain all necessary & complete request.
Client application must keep the session state.
4. Cacheable
Responses should be labelled cacheable or non – cacheable.
If cacheable, response data can be reused for a specified period.
5. Layered System
Hierarchical layers, each component can’t be seen beyond the layer they are
interacting.
6. Code on Demand (Optional) – reduces re - implementation
Resource
• Key abstraction of information
• Any information is a resource.
• Resource Representation – state of the resource.
• Resource Representations consist of
• Data
• Metadata
• Hypermedia links – helps client to transition to the next desired state.
Resource
• Resource Identifiers
• Used to identify each resource involved in the interactions between the client
and server components
• Hypermedia
• Media type – data format of the representation
• RESTful API looks like a hypertext.
• Self – Descriptive
• Resource representations shall be self – descriptive.
• Client doesn’t need to know if resource is a device or an employee.

pdf on big dataanalytics_unit1withslideshare.pptx

  • 1.
  • 2.
    REST • Acronym forREpresentational State Transfer. • It is NOT A PROTOCOL • It is an architectural style • A Web API conforming to the REST architectural style is called a REST API (or RESTful API).
  • 3.
    Guiding Principles • Theseprovides simplicity, scalability and statelessness. • The six guiding principles or constraints are:
  • 4.
    Principles 1. Uniform Interface Identificationof resources – unique identity Manipulation of resources through representations – uniform server response representations, used to modify resource state in server Self – descriptive messages – info. on message processing, additional information’s 2. Client – Server Separation of concerns of client & server. Improves portability across platform Improves scalability by simplifying server components Make sure the client server interface doesn’t break
  • 5.
    Principles 3. Stateless Each clientrequest must contain all necessary & complete request. Client application must keep the session state. 4. Cacheable Responses should be labelled cacheable or non – cacheable. If cacheable, response data can be reused for a specified period. 5. Layered System Hierarchical layers, each component can’t be seen beyond the layer they are interacting. 6. Code on Demand (Optional) – reduces re - implementation
  • 6.
    Resource • Key abstractionof information • Any information is a resource. • Resource Representation – state of the resource. • Resource Representations consist of • Data • Metadata • Hypermedia links – helps client to transition to the next desired state.
  • 7.
    Resource • Resource Identifiers •Used to identify each resource involved in the interactions between the client and server components • Hypermedia • Media type – data format of the representation • RESTful API looks like a hypertext. • Self – Descriptive • Resource representations shall be self – descriptive. • Client doesn’t need to know if resource is a device or an employee.