SlideShare a Scribd company logo
REST &
RESTful WEB SERVICE
Power Lunch by Vu Tran
REST & RESTful WEB SERVICE
● REST
● REST Characteristics
● RESTful Web Service
REST
Communication
Server Server
REST
● REST stands for Representational State Transfer
● It is an architectural pattern for developing web
services as opposed to a specification
● REST web services communicate over the HTTP
specification, using HTTP vocabulary
– Methods (GET, POST, etc.)
– HTTP URI syntax (paths, parameters, etc.)
– HTTP Response codes.
– Media types (xml, json, html, plain text, etc)
HTTP-REST Request Basics
The HTTP request is sent from the client.
– Identifies the location of a resource (URL)
– Specifies the verb, or HTTP method (GET, POST, etc).
– Supplies optional request headers (GET - e.g. name-value
pairs)
– Supplies an optional request body (POST - e.g. form
parameters, attachments, etc.)
HTTP-REST Request Basics
API Server
http://customer.info/customers/12345
Client
● URL : http://customer.info/getCustomersInfo
● Verb or HTTP method : GET
● Request headers : ?id=12345
● Request body : NA
HTTP-REST Response Basics
The HTTP response is sent from the server.
– Gives the status of the processed request. (HTTP code)
– Supplies response headers (name-value pairs) that
provide additional information about the response.
– Supplies an optional response body that identifies
additional data to be downloaded to the client (html, xml,
binary data, etc.)
HTTP-REST Response Basics
API Server
Client
● HTTP status : 200 OK
● Response headers
Content-Type: text/html
Content-Length: 1024
● Response body
<html>
<!-- some HTML content →
</html>
Response
REST Characteristics
Resources
● URI: Every resource is uniquely addressable using URIs.
Constraints
● Client-Server
● Stateless
● Cacheable
● Layered
● Code on demand (optional)
● Uniform Interface
o Method : Use only HTTP methods (GET, POST, PUT,
DELETE)
o Representation : json, xml, etc
Client-Server
1. Separation of concerns.
2. Client and server are independent from each other.
3. Client doesn’t know anything about the resource which
is kept in the server.
4. Server responds as long as the right requests come in.
➔ Goal: Platform independency and to improve scalability.
Stateless
1. Each request is independent from other requests.
2. No client session data or any context stored on the
server.
3. Every request from client stores the required
information, so that the server can respond.
4. If there are needs for session-specific data, it should be
held and maintained by the client and transferred to the
server with each request as needed.
5. A service layer which doesn’t have to maintain client
sessions is much easier to scale.
Cacheable
1. HTTP responses must be cacheable by the clients.
2. Important for performance.
3. If a new request for the resources comes within a while,
then the cached response will be returned.
Layered System
1. There can be many intermediaries between you and the server you
are connecting to.
2. Actually, a client does not know if it is connected to the last server
or an intermediary server.
3. Intermediaries may improve performance by caching and message
passing.
4. Intermediary servers can increase scalability by load-balancing and
can force clients to form some sort of security policies.
5. This structure can be used when encapsulation is needed.
Code on Demand (optional)
1. Servers can send some kind of executable scripts to the client-
side in order to increase or change the functionality on the client
side.
2. This may cause low visibility, so it is the only optional constraint.
EXAMPLE :
...
<head>
<script src="utility.js" type="text/javascript">
</script>
</head
..
Uniform Interface
1. All resources share a uniform interface for the transfer of state
between client and resource, consisting of
o HTTP Method
o HTTP Status Code
HTTP Methods
OPERATION HTTP METHOD Characteristic
Create POST
Read GET safe, idempotent, cacheable
Update PUT (or POST) idempotent
Delete DELETE idempotent
➔ Idempotent : meaning that the operation will produce the same result no matter how many times
it is repeated
HTTP Status Code
HTTP Status Code Group Comment
1xx Informational (100,101)
2xx Success (200,201)
3xx Redirect (301, 304)
4xx Client error (401, 404, 405)
5xx Server error (500, 503)
RESTful WEB SERVICE
Constraints
● Client-Server
● Stateless
● Cacheable
● Layered
● Code on demand (optional)
● Uniform Interface
➔ If a service does not include all constraints out of «Code on
Demand», it is not a RESTful web service.
RESTful Examplehttp://customer.info/customers/ http://customer.info/customers/12345
GET List the URIs and perhaps other
details of the collection's
customers.
Retrieve a representation of the
addressed customer of the
collection.
PUT Not generally used. Replace the addressed customer of
the collection, or if it does not exist,
create it.
POST Create a new customer’s entry in
the collection.
Not generally used.
DELETE Delete the entire collection. Delete the addressed customer of
the collection.
THANK YOU !!!
Ad

More Related Content

What's hot (20)

REST API
REST APIREST API
REST API
Tofazzal Ahmed
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
Aniruddh Bhilvare
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
Go micro framework to build microservices
Go micro framework to build microservicesGo micro framework to build microservices
Go micro framework to build microservices
TechMaster Vietnam
 
Support Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFISupport Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFI
ENSET, Université Hassan II Casablanca
 
API : l'architecture REST
API : l'architecture RESTAPI : l'architecture REST
API : l'architecture REST
Fadel Chafai
 
Express node js
Express node jsExpress node js
Express node js
Yashprit Singh
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
Surbhi Panhalkar
 
Architectures orientés services (SOA)
Architectures orientés services (SOA)Architectures orientés services (SOA)
Architectures orientés services (SOA)
Heithem Abbes
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
Peter R. Egli
 
제프리 리처의 Windows via C/C++ : 8장 유저 모드에서의 스레드 동기화
제프리 리처의 Windows via C/C++ : 8장 유저 모드에서의 스레드 동기화제프리 리처의 Windows via C/C++ : 8장 유저 모드에서의 스레드 동기화
제프리 리처의 Windows via C/C++ : 8장 유저 모드에서의 스레드 동기화
sung ki choi
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
Sahil Agarwal
 
Rest web services
Rest web servicesRest web services
Rest web services
Paulo Gandra de Sousa
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
Jafar Nesargi
 
TypeScript - An Introduction
TypeScript - An IntroductionTypeScript - An Introduction
TypeScript - An Introduction
NexThoughts Technologies
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
Siddharth Sharma
 
REST and RESTful Web Services
REST and RESTful Web ServicesREST and RESTful Web Services
REST and RESTful Web Services
Kasun Madusanke
 
WebLogic Scripting Tool Overview
WebLogic Scripting Tool OverviewWebLogic Scripting Tool Overview
WebLogic Scripting Tool Overview
James Bayer
 
Web api
Web apiWeb api
Web api
Sudhakar Sharma
 
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
Tchelinux
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
Go micro framework to build microservices
Go micro framework to build microservicesGo micro framework to build microservices
Go micro framework to build microservices
TechMaster Vietnam
 
API : l'architecture REST
API : l'architecture RESTAPI : l'architecture REST
API : l'architecture REST
Fadel Chafai
 
Architectures orientés services (SOA)
Architectures orientés services (SOA)Architectures orientés services (SOA)
Architectures orientés services (SOA)
Heithem Abbes
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
Peter R. Egli
 
제프리 리처의 Windows via C/C++ : 8장 유저 모드에서의 스레드 동기화
제프리 리처의 Windows via C/C++ : 8장 유저 모드에서의 스레드 동기화제프리 리처의 Windows via C/C++ : 8장 유저 모드에서의 스레드 동기화
제프리 리처의 Windows via C/C++ : 8장 유저 모드에서의 스레드 동기화
sung ki choi
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
Sahil Agarwal
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
Jafar Nesargi
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
Siddharth Sharma
 
REST and RESTful Web Services
REST and RESTful Web ServicesREST and RESTful Web Services
REST and RESTful Web Services
Kasun Madusanke
 
WebLogic Scripting Tool Overview
WebLogic Scripting Tool OverviewWebLogic Scripting Tool Overview
WebLogic Scripting Tool Overview
James Bayer
 
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
Tchelinux
 

Viewers also liked (20)

RESTful web
RESTful webRESTful web
RESTful web
Alvin Qi
 
Intoduction to php restful web service
Intoduction to php  restful web serviceIntoduction to php  restful web service
Intoduction to php restful web service
baabtra.com - No. 1 supplier of quality freshers
 
Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)
Adnan Sohail
 
Simple service rest
Simple service restSimple service rest
Simple service rest
Domenico Schiavone
 
Web Services Atomic Transactio
 Web Services Atomic Transactio Web Services Atomic Transactio
Web Services Atomic Transactio
Roger Xia
 
WS-Privacy,
WS-Privacy,WS-Privacy,
WS-Privacy,
webhostingguy
 
Frank Leymann @ BPMN 2010
Frank Leymann @ BPMN 2010Frank Leymann @ BPMN 2010
Frank Leymann @ BPMN 2010
bpmn2010
 
Soa & Bpel With Web Sphere
Soa & Bpel With Web SphereSoa & Bpel With Web Sphere
Soa & Bpel With Web Sphere
lakshmi isukapally
 
Semantic Web Services: A RESTful Approach
Semantic Web Services: A RESTful ApproachSemantic Web Services: A RESTful Approach
Semantic Web Services: A RESTful Approach
Otavio Ferreira
 
Semantic web service
Semantic web serviceSemantic web service
Semantic web service
jean Agnimel
 
Atomic Service Transactions
Atomic Service Transactions Atomic Service Transactions
Atomic Service Transactions
WSO2
 
Semantic web services
Semantic web servicesSemantic web services
Semantic web services
Mergani Eltahir
 
Business Models for Open Source Hardware
Business Models for Open Source HardwareBusiness Models for Open Source Hardware
Business Models for Open Source Hardware
Benjamin Tincq
 
Introduction and Advanced Concepts of BPEL
Introduction and Advanced Concepts of BPELIntroduction and Advanced Concepts of BPEL
Introduction and Advanced Concepts of BPEL
Denis Weerasiri
 
Soa & Bpel
Soa & BpelSoa & Bpel
Soa & Bpel
lakshmi isukapally
 
The Semantic Web #9 - Web Ontology Language (OWL)
The Semantic Web #9 - Web Ontology Language (OWL)The Semantic Web #9 - Web Ontology Language (OWL)
The Semantic Web #9 - Web Ontology Language (OWL)
Myungjin Lee
 
Json tutorial
Json tutorialJson tutorial
Json tutorial
Mohammed Bilal
 
BPEL, BPEL vs ESB (Integration)
BPEL, BPEL vs ESB (Integration)BPEL, BPEL vs ESB (Integration)
BPEL, BPEL vs ESB (Integration)
ejlp12
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
Sreeni I
 
REST Presentation
REST PresentationREST Presentation
REST Presentation
Alexandros Marinos
 
RESTful web
RESTful webRESTful web
RESTful web
Alvin Qi
 
Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)
Adnan Sohail
 
Web Services Atomic Transactio
 Web Services Atomic Transactio Web Services Atomic Transactio
Web Services Atomic Transactio
Roger Xia
 
Frank Leymann @ BPMN 2010
Frank Leymann @ BPMN 2010Frank Leymann @ BPMN 2010
Frank Leymann @ BPMN 2010
bpmn2010
 
Semantic Web Services: A RESTful Approach
Semantic Web Services: A RESTful ApproachSemantic Web Services: A RESTful Approach
Semantic Web Services: A RESTful Approach
Otavio Ferreira
 
Semantic web service
Semantic web serviceSemantic web service
Semantic web service
jean Agnimel
 
Atomic Service Transactions
Atomic Service Transactions Atomic Service Transactions
Atomic Service Transactions
WSO2
 
Business Models for Open Source Hardware
Business Models for Open Source HardwareBusiness Models for Open Source Hardware
Business Models for Open Source Hardware
Benjamin Tincq
 
Introduction and Advanced Concepts of BPEL
Introduction and Advanced Concepts of BPELIntroduction and Advanced Concepts of BPEL
Introduction and Advanced Concepts of BPEL
Denis Weerasiri
 
The Semantic Web #9 - Web Ontology Language (OWL)
The Semantic Web #9 - Web Ontology Language (OWL)The Semantic Web #9 - Web Ontology Language (OWL)
The Semantic Web #9 - Web Ontology Language (OWL)
Myungjin Lee
 
BPEL, BPEL vs ESB (Integration)
BPEL, BPEL vs ESB (Integration)BPEL, BPEL vs ESB (Integration)
BPEL, BPEL vs ESB (Integration)
ejlp12
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
Sreeni I
 
Ad

Similar to REST & RESTful Web Service (20)

Restful web services with java
Restful web services with javaRestful web services with java
Restful web services with java
Vinay Gopinath
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
Mahek Merchant
 
RESTful web services using java and spring
RESTful web services using java and springRESTful web services using java and spring
RESTful web services using java and spring
Muhammad Junaid Ansari
 
6 Months Industrial Training in Spring Framework
6 Months Industrial Training in Spring Framework6 Months Industrial Training in Spring Framework
6 Months Industrial Training in Spring Framework
Arcadian Learning
 
SOAP vs REST
SOAP vs RESTSOAP vs REST
SOAP vs REST
Nadia Boumaza
 
A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2
VivekKrishna34
 
HTTP
HTTPHTTP
HTTP
MaeEstherMaguadMaralit
 
Web architecturesWeb architecturesWeb architectures
Web architecturesWeb architecturesWeb architecturesWeb architecturesWeb architecturesWeb architectures
Web architecturesWeb architecturesWeb architectures
ShafeequeAhmed19
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
Jeelani Shaik
 
Ch-1_.ppt
Ch-1_.pptCh-1_.ppt
Ch-1_.ppt
berihunmolla2
 
Servlet (1) also contains code to create it.ppt
Servlet (1) also contains code to create it.pptServlet (1) also contains code to create it.ppt
Servlet (1) also contains code to create it.ppt
juhishrivastava25
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
Dong Ngoc
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
MouDhara1
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
kstalin2
 
Servlet1.ppt
Servlet1.pptServlet1.ppt
Servlet1.ppt
KhushalChoudhary14
 
Servlet123jkhuiyhkjkljioyudfrtsdrestfhgb
Servlet123jkhuiyhkjkljioyudfrtsdrestfhgbServlet123jkhuiyhkjkljioyudfrtsdrestfhgb
Servlet123jkhuiyhkjkljioyudfrtsdrestfhgb
shubhangimalas1
 
Rest
RestRest
Rest
Prabhat gangwar
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
Todd Benson (I.T. SPECIALIST and I.T. SECURITY)
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
Kong King
 
Ad

Recently uploaded (20)

TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 

REST & RESTful Web Service

  • 1. REST & RESTful WEB SERVICE Power Lunch by Vu Tran
  • 2. REST & RESTful WEB SERVICE ● REST ● REST Characteristics ● RESTful Web Service
  • 4. REST ● REST stands for Representational State Transfer ● It is an architectural pattern for developing web services as opposed to a specification ● REST web services communicate over the HTTP specification, using HTTP vocabulary – Methods (GET, POST, etc.) – HTTP URI syntax (paths, parameters, etc.) – HTTP Response codes. – Media types (xml, json, html, plain text, etc)
  • 5. HTTP-REST Request Basics The HTTP request is sent from the client. – Identifies the location of a resource (URL) – Specifies the verb, or HTTP method (GET, POST, etc). – Supplies optional request headers (GET - e.g. name-value pairs) – Supplies an optional request body (POST - e.g. form parameters, attachments, etc.)
  • 6. HTTP-REST Request Basics API Server http://customer.info/customers/12345 Client ● URL : http://customer.info/getCustomersInfo ● Verb or HTTP method : GET ● Request headers : ?id=12345 ● Request body : NA
  • 7. HTTP-REST Response Basics The HTTP response is sent from the server. – Gives the status of the processed request. (HTTP code) – Supplies response headers (name-value pairs) that provide additional information about the response. – Supplies an optional response body that identifies additional data to be downloaded to the client (html, xml, binary data, etc.)
  • 8. HTTP-REST Response Basics API Server Client ● HTTP status : 200 OK ● Response headers Content-Type: text/html Content-Length: 1024 ● Response body <html> <!-- some HTML content → </html> Response
  • 9. REST Characteristics Resources ● URI: Every resource is uniquely addressable using URIs. Constraints ● Client-Server ● Stateless ● Cacheable ● Layered ● Code on demand (optional) ● Uniform Interface o Method : Use only HTTP methods (GET, POST, PUT, DELETE) o Representation : json, xml, etc
  • 10. Client-Server 1. Separation of concerns. 2. Client and server are independent from each other. 3. Client doesn’t know anything about the resource which is kept in the server. 4. Server responds as long as the right requests come in. ➔ Goal: Platform independency and to improve scalability.
  • 11. Stateless 1. Each request is independent from other requests. 2. No client session data or any context stored on the server. 3. Every request from client stores the required information, so that the server can respond. 4. If there are needs for session-specific data, it should be held and maintained by the client and transferred to the server with each request as needed. 5. A service layer which doesn’t have to maintain client sessions is much easier to scale.
  • 12. Cacheable 1. HTTP responses must be cacheable by the clients. 2. Important for performance. 3. If a new request for the resources comes within a while, then the cached response will be returned.
  • 13. Layered System 1. There can be many intermediaries between you and the server you are connecting to. 2. Actually, a client does not know if it is connected to the last server or an intermediary server. 3. Intermediaries may improve performance by caching and message passing. 4. Intermediary servers can increase scalability by load-balancing and can force clients to form some sort of security policies. 5. This structure can be used when encapsulation is needed.
  • 14. Code on Demand (optional) 1. Servers can send some kind of executable scripts to the client- side in order to increase or change the functionality on the client side. 2. This may cause low visibility, so it is the only optional constraint. EXAMPLE : ... <head> <script src="utility.js" type="text/javascript"> </script> </head ..
  • 15. Uniform Interface 1. All resources share a uniform interface for the transfer of state between client and resource, consisting of o HTTP Method o HTTP Status Code
  • 16. HTTP Methods OPERATION HTTP METHOD Characteristic Create POST Read GET safe, idempotent, cacheable Update PUT (or POST) idempotent Delete DELETE idempotent ➔ Idempotent : meaning that the operation will produce the same result no matter how many times it is repeated
  • 17. HTTP Status Code HTTP Status Code Group Comment 1xx Informational (100,101) 2xx Success (200,201) 3xx Redirect (301, 304) 4xx Client error (401, 404, 405) 5xx Server error (500, 503)
  • 18. RESTful WEB SERVICE Constraints ● Client-Server ● Stateless ● Cacheable ● Layered ● Code on demand (optional) ● Uniform Interface ➔ If a service does not include all constraints out of «Code on Demand», it is not a RESTful web service.
  • 19. RESTful Examplehttp://customer.info/customers/ http://customer.info/customers/12345 GET List the URIs and perhaps other details of the collection's customers. Retrieve a representation of the addressed customer of the collection. PUT Not generally used. Replace the addressed customer of the collection, or if it does not exist, create it. POST Create a new customer’s entry in the collection. Not generally used. DELETE Delete the entire collection. Delete the addressed customer of the collection.