Top Banner
13
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to REST - API
Page 2: Introduction to REST - API

Background

HTTP Overview

REST - API Overview

Design Constraints

Benefits

Examples

Page 3: Introduction to REST - API

Developed by W3C - World Wide Web Consortium

Technical Architecture Group (TAG) in parallel with HTTP 1.1

Software architecture

Components

Connectors

Data

Architectural properties

Page 4: Introduction to REST - API

Allows for sending documents back & forth on the web.

URL’s Identifies a “Resource”.

/Team - identify all Team

/Team/QA/ABC - identify the Member of a team.

HTTP Verbs

GET / PUT / DELETE / POST

Representations

Response Codes

200 OK

201 Created

500 Internal Server Error

400 Bad Request

404 Not Found

Page 5: Introduction to REST - API

REST – API Stands for?

Request Static Transfer

Remote State Transfer

Remote Stored Transfer

Remote Static Transfer

Correct Answer is…

REpresentational State Transfer

Page 6: Introduction to REST - API

Relies on a

Stateless

Client - Server

Cacheable communications protocol

HTTP protocol is used.

Architecture Style for designing networked applications

The Design Constraints for REST – API style.

Page 7: Introduction to REST - API

Uniform Interface

Simplifies and Decouples the architecture.

Enables each part to evolve independently.

Four guiding principles

Resource-Based

Manipulation of Resources Through Representations

Self-descriptive Messages

Hypermedia as the Engine of Application State (HATEOAS)

Page 8: Introduction to REST - API

Stateless

State to handle the request is contained within the request itself.

The URI uniquely identifies the resource and the body contains the state

(or state change) of that resource.

After Server Process - communicated back to the client via headers,

status and response body.

Enables greater scalability - server does not have to maintain, update or

communicate that session state.

Load balancers don't have to worry about session affinity for stateless

systems

Page 9: Introduction to REST - API

Cacheable

Well-managed caching partially or completely eliminates some client–

server interactions, further improving scalability and performance.

Client-Server

Uniform interface separates clients from servers.

Clients are not concerned with data storage - portability of client code is

improved.

Servers are not concerned with the user interface or user state - servers

can be simpler and more scalable

Page 10: Introduction to REST - API

Layered System

A client cannot connected directly to the end server.

A client may connected with Server via Intermediary servers.

Intermediary servers may improve system scalability by enabling load-

balancing.

Helps to enforce security policies.

Page 11: Introduction to REST - API

Network Performance

Efficiency - Caching data

Scalability - Gateway, Proxy and layered

User Perceived Performance - Caching

pre-fetched information

- Eg: Form Validation

Page 12: Introduction to REST - API
Page 13: Introduction to REST - API