SlideShare uma empresa Scribd logo
1 de 24
Baixar para ler offline
REST 
in theory 
by Alex Muntada / @alexmuntada
What makes Internet a success? 
World Wide Web
What makes the Web a success? 
easy 
customized 
linked 
pervasive
Timeline
Architectural Styles and the 
Design of Network-based 
Software Architectures 
Roy Fielding (2000)
SOAP 1.2 
W3C recommendation (2003)
RESTful Web Services 
Leonard Richardson, Sam Ruby (2007)
REST becomes a success
RESTful Web APIs 
Leonard Richardson, Mike Amundsen, Sam Ruby (2013)
REST(ful) 
“Representational state transfer (REST) is a software 
architectural style consisting of a coordinated set of 
architectural constraints applied to components, 
connectors, and data elements, within a distributed 
hypermedia system.”
Architectural Properties of the Web 
Low Entry-Barrier (easy) 
Extensibility (customized) 
Distributed Hypermedia (linked) 
Internet-Scale (pervasive)
Interface Constraints 
Identification of Resources (URIs) 
Manipulation of Resources Through Representations 
Self-Descriptive Messages (stateless) 
The Hypermedia Constraint (HATEOAS)
HATEOAS 
“Hypermedia as the engine of application state.” 
All application state is kept on the client side. 
The client can only change it through HTTP requests and responses. 
The client can find next actions through hypermedia controls. 
Hypermedia controls drive changes in application state.
Architectural Constraints 
Client-Server (one to one) 
Statelessness (application state, resource state) 
Caching (if-modified-since, if-match, 304) 
Uniform Interface 
Layered System (proxies, gateways) 
Code on Demand (javascript)
APIs
What is your worst nightmare in APIs? 
Documentation 
Bad, old, wrong or lack thereof.
Twitter REST API v1.1 
POST statuses/update 
Resource URL: https://api.twitter.com/1.1/statuses/update.json 
HTTP Methods: POST 
Response Formats: json 
Parameters: status (required), in_reply_to_status_id, lat, long, place_id, 
display_coordinates, trim_user
What is missing in this example? 
POST /1.1/statuses/update.json HTTP/1.1 
User-Agent: curl/7.35.0 
Host: api.twitter.com 
Accept: */* 
Content-Length: 68 
Content-Type: application/x-www-form-urlencoded 
status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk 
HTTP/1.1 400 Bad Request 
content-length: 61 
content-type: application/json; charset=utf-8 
date: Sun, 18 May 2014 19:30:43 UTC 
server: tfe 
set-cookie: guest_id=v1%3A140044144371735781; Domain=.twitter.com; Path=/; Expires=Tue, 17-May-2016 19:30:43 strict-transport-security: max-age=631138519 
x-tfe-logging-request-category: API 
{"errors":[{"message":"Bad Authentication data","code":215}]}
How can I fix it? 
POST /1.1/statuses/update.json HTTP/1.1 
User-Agent: curl/7.35.0 
Host: api.twitter.com 
Accept: */* 
Content-Length: 68 
Content-Type: application/x-www-form-urlencoded 
Authorization: 
OAuth oauth_consumer_key="xvz1evFS4wEEPTGEFPHBog", 
oauth_nonce="kYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg", 
oauth_signature="tnnArxj06cWHq44gCs1OSKk%2FjLY%3D", 
oauth_signature_method="HMAC-SHA1", 
oauth_timestamp="1318622958", 
oauth_token="370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb", 
oauth_version="1.0" 
status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk
How did I find that? 
Read several pages of documentation: 
1. 
POST statuses/update 
2. 
Application-user authentication 
3. 
Using OAuth 
4. 
Authorizing a request
The Semantic Gap 
“The gap between the structure of a document and its 
real-world meaning—its application semantics. 
Media types, machine-readable profiles, and human-readable 
documentation bridge the semantic gap in 
different ways, but bridging the gap always requires 
the intervention of a human being at some point.” 
RESTful Web APIs, p. 360
Final Thoughts 
Try to use less documentation and more hypermedia. 
Use existing standards, content types, link relations, etc. 
Propose new ones when there are none. 
Think about Internet-scale APIs. 
Let your APIs socialize with other APIs. 
Embrace the semantic challenge!
Questions? 
by Alex Muntada / @alexmuntada
REST in peace!

Mais conteúdo relacionado

Destaque

Cascao Leipzig Waterscapes Nile Basin
Cascao Leipzig Waterscapes Nile BasinCascao Leipzig Waterscapes Nile Basin
Cascao Leipzig Waterscapes Nile BasinAna Cascao
 
Cascao Slovenia Transboundary Water Resources Power
Cascao Slovenia Transboundary Water Resources PowerCascao Slovenia Transboundary Water Resources Power
Cascao Slovenia Transboundary Water Resources PowerAna Cascao
 
The State of Marketing 2012
The State of Marketing 2012The State of Marketing 2012
The State of Marketing 2012Allie Kelly
 
zardaszuzek - MéRnöKké VáLáS Folyamata
zardaszuzek - MéRnöKké VáLáS Folyamatazardaszuzek - MéRnöKké VáLáS Folyamata
zardaszuzek - MéRnöKké VáLáS Folyamatazardaszuzek
 
Rastreo y monitorización de usuarios. Aspectos legales
Rastreo y monitorización de usuarios. Aspectos legalesRastreo y monitorización de usuarios. Aspectos legales
Rastreo y monitorización de usuarios. Aspectos legalesAbanlex
 
A MéRnöKké VáLáS RöGöS úTja
A MéRnöKké VáLáS RöGöS úTjaA MéRnöKké VáLáS RöGöS úTja
A MéRnöKké VáLáS RöGöS úTjaguestbeafe8
 
Basics of Project Management: Clarity, Collaboration, and Cognition
Basics of Project Management: Clarity, Collaboration, and CognitionBasics of Project Management: Clarity, Collaboration, and Cognition
Basics of Project Management: Clarity, Collaboration, and Cognitiontcg: agency
 
παρουσιαση μοντελου σχεδιου εργασίας
παρουσιαση μοντελου σχεδιου εργασίαςπαρουσιαση μοντελου σχεδιου εργασίας
παρουσιαση μοντελου σχεδιου εργασίαςpramas
 
Conversations with the Pre-Customer
Conversations with the Pre-CustomerConversations with the Pre-Customer
Conversations with the Pre-CustomerPete Jakob
 
Improving the correlation hunting in a large quantity of SOM component planes
Improving the correlation hunting in a largequantity of SOM component planesImproving the correlation hunting in a largequantity of SOM component planes
Improving the correlation hunting in a large quantity of SOM component planesaskroll
 
Memory Forensics for Pentesters: Firefox
Memory Forensics for Pentesters: FirefoxMemory Forensics for Pentesters: Firefox
Memory Forensics for Pentesters: FirefoxRob Fuller
 
Renkomäen koulun veso 30.5.2011
Renkomäen koulun veso 30.5.2011Renkomäen koulun veso 30.5.2011
Renkomäen koulun veso 30.5.2011Jukka Manninen
 
From Idea to Exit, the story of our startup
From Idea to Exit, the story of our startupFrom Idea to Exit, the story of our startup
From Idea to Exit, the story of our startupNatalie Downe
 
Indonesian Photos 01
Indonesian Photos   01Indonesian Photos   01
Indonesian Photos 01sutrisno2629
 
Playford Enterprises 5 Year Plan - Summary Business Plan 3
Playford Enterprises 5 Year  Plan - Summary Business Plan 3Playford Enterprises 5 Year  Plan - Summary Business Plan 3
Playford Enterprises 5 Year Plan - Summary Business Plan 3Effrim Volkoff, CPA
 
As The Phish Turns
As The Phish TurnsAs The Phish Turns
As The Phish TurnsRob Fuller
 

Destaque (20)

Cascao Leipzig Waterscapes Nile Basin
Cascao Leipzig Waterscapes Nile BasinCascao Leipzig Waterscapes Nile Basin
Cascao Leipzig Waterscapes Nile Basin
 
Cascao Slovenia Transboundary Water Resources Power
Cascao Slovenia Transboundary Water Resources PowerCascao Slovenia Transboundary Water Resources Power
Cascao Slovenia Transboundary Water Resources Power
 
Iui protocol -draft
Iui protocol -draftIui protocol -draft
Iui protocol -draft
 
The State of Marketing 2012
The State of Marketing 2012The State of Marketing 2012
The State of Marketing 2012
 
zardaszuzek - MéRnöKké VáLáS Folyamata
zardaszuzek - MéRnöKké VáLáS Folyamatazardaszuzek - MéRnöKké VáLáS Folyamata
zardaszuzek - MéRnöKké VáLáS Folyamata
 
Rastreo y monitorización de usuarios. Aspectos legales
Rastreo y monitorización de usuarios. Aspectos legalesRastreo y monitorización de usuarios. Aspectos legales
Rastreo y monitorización de usuarios. Aspectos legales
 
A MéRnöKké VáLáS RöGöS úTja
A MéRnöKké VáLáS RöGöS úTjaA MéRnöKké VáLáS RöGöS úTja
A MéRnöKké VáLáS RöGöS úTja
 
Basics of Project Management: Clarity, Collaboration, and Cognition
Basics of Project Management: Clarity, Collaboration, and CognitionBasics of Project Management: Clarity, Collaboration, and Cognition
Basics of Project Management: Clarity, Collaboration, and Cognition
 
παρουσιαση μοντελου σχεδιου εργασίας
παρουσιαση μοντελου σχεδιου εργασίαςπαρουσιαση μοντελου σχεδιου εργασίας
παρουσιαση μοντελου σχεδιου εργασίας
 
Conversations with the Pre-Customer
Conversations with the Pre-CustomerConversations with the Pre-Customer
Conversations with the Pre-Customer
 
Improving the correlation hunting in a large quantity of SOM component planes
Improving the correlation hunting in a largequantity of SOM component planesImproving the correlation hunting in a largequantity of SOM component planes
Improving the correlation hunting in a large quantity of SOM component planes
 
Memory Forensics for Pentesters: Firefox
Memory Forensics for Pentesters: FirefoxMemory Forensics for Pentesters: Firefox
Memory Forensics for Pentesters: Firefox
 
Renkomäen koulun veso 30.5.2011
Renkomäen koulun veso 30.5.2011Renkomäen koulun veso 30.5.2011
Renkomäen koulun veso 30.5.2011
 
From Idea to Exit, the story of our startup
From Idea to Exit, the story of our startupFrom Idea to Exit, the story of our startup
From Idea to Exit, the story of our startup
 
Erik Scarcia
Erik Scarcia Erik Scarcia
Erik Scarcia
 
God Wont Ask
God Wont AskGod Wont Ask
God Wont Ask
 
Indonesian Photos 01
Indonesian Photos   01Indonesian Photos   01
Indonesian Photos 01
 
Playford Enterprises 5 Year Plan - Summary Business Plan 3
Playford Enterprises 5 Year  Plan - Summary Business Plan 3Playford Enterprises 5 Year  Plan - Summary Business Plan 3
Playford Enterprises 5 Year Plan - Summary Business Plan 3
 
As The Phish Turns
As The Phish TurnsAs The Phish Turns
As The Phish Turns
 
BlackDog Brand Manifesto
BlackDog Brand ManifestoBlackDog Brand Manifesto
BlackDog Brand Manifesto
 

Semelhante a REST in theory

53 hui homework2
53 hui homework253 hui homework2
53 hui homework2huis89
 
Creating Restful Web Services with restish
Creating Restful Web Services with restishCreating Restful Web Services with restish
Creating Restful Web Services with restishGrig Gheorghiu
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
 
Web2 0 Incredibles
Web2 0 IncrediblesWeb2 0 Incredibles
Web2 0 Incrediblesanjeshdubey
 
Time to REST: testing web services
Time to REST: testing web servicesTime to REST: testing web services
Time to REST: testing web servicesIurii Kutelmakh
 
200211 Fielding Apachecon
200211 Fielding Apachecon200211 Fielding Apachecon
200211 Fielding ApacheconDaniel Parker
 
REST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionREST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionGlenn Antoine
 
REST and the Hypermedia Constraint
REST and the Hypermedia ConstraintREST and the Hypermedia Constraint
REST and the Hypermedia ConstraintInviqa
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - APIChetan Gadodia
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Sumy PHP User Grpoup
 
Slim 3 PHP micro framework
Slim 3 PHP micro frameworkSlim 3 PHP micro framework
Slim 3 PHP micro frameworkKanushka Gayan
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST AssuredTO THE NEW Pvt. Ltd.
 

Semelhante a REST in theory (20)

WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
 
53 hui homework2
53 hui homework253 hui homework2
53 hui homework2
 
Creating Restful Web Services with restish
Creating Restful Web Services with restishCreating Restful Web Services with restish
Creating Restful Web Services with restish
 
Future Internet
Future InternetFuture Internet
Future Internet
 
Rest web service
Rest web serviceRest web service
Rest web service
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 
Web2 0 Incredibles
Web2 0 IncrediblesWeb2 0 Incredibles
Web2 0 Incredibles
 
Time to REST: testing web services
Time to REST: testing web servicesTime to REST: testing web services
Time to REST: testing web services
 
200211 Fielding Apachecon
200211 Fielding Apachecon200211 Fielding Apachecon
200211 Fielding Apachecon
 
Mini-Training: Let's have a rest
Mini-Training: Let's have a restMini-Training: Let's have a rest
Mini-Training: Let's have a rest
 
REST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionREST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of Confusion
 
REST != WebAPI
REST != WebAPIREST != WebAPI
REST != WebAPI
 
REST and the Hypermedia Constraint
REST and the Hypermedia ConstraintREST and the Hypermedia Constraint
REST and the Hypermedia Constraint
 
What is an API?
What is an API?What is an API?
What is an API?
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - API
 
About HTTP and REST
About HTTP and RESTAbout HTTP and REST
About HTTP and REST
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
 
Restful web services
Restful web servicesRestful web services
Restful web services
 
Slim 3 PHP micro framework
Slim 3 PHP micro frameworkSlim 3 PHP micro framework
Slim 3 PHP micro framework
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
 

Mais de Alex Muntada Duran

Equips cibernètics, realitat o ficció? (Jornada TIC UPC 2017)
Equips cibernètics, realitat o ficció? (Jornada TIC UPC 2017)Equips cibernètics, realitat o ficció? (Jornada TIC UPC 2017)
Equips cibernètics, realitat o ficció? (Jornada TIC UPC 2017)Alex Muntada Duran
 
Desenvolupament al projecte Debian
Desenvolupament al projecte DebianDesenvolupament al projecte Debian
Desenvolupament al projecte DebianAlex Muntada Duran
 
Orientació a objectes amb Moose
Orientació a objectes amb MooseOrientació a objectes amb Moose
Orientació a objectes amb MooseAlex Muntada Duran
 
Programació orientada a objectes en Perl
Programació orientada a objectes en PerlProgramació orientada a objectes en Perl
Programació orientada a objectes en PerlAlex Muntada Duran
 
Cloenda del Curs d'introducció a Perl 2011
Cloenda del Curs d'introducció a Perl 2011Cloenda del Curs d'introducció a Perl 2011
Cloenda del Curs d'introducció a Perl 2011Alex Muntada Duran
 
Benvinguda al Curs d'introducció a Perl 2011
Benvinguda al Curs d'introducció a Perl 2011Benvinguda al Curs d'introducció a Perl 2011
Benvinguda al Curs d'introducció a Perl 2011Alex Muntada Duran
 

Mais de Alex Muntada Duran (11)

Equips cibernètics, realitat o ficció? (Jornada TIC UPC 2017)
Equips cibernètics, realitat o ficció? (Jornada TIC UPC 2017)Equips cibernètics, realitat o ficció? (Jornada TIC UPC 2017)
Equips cibernètics, realitat o ficció? (Jornada TIC UPC 2017)
 
Desenvolupament al projecte Debian
Desenvolupament al projecte DebianDesenvolupament al projecte Debian
Desenvolupament al projecte Debian
 
Comiat del curs de Perl
Comiat del curs de PerlComiat del curs de Perl
Comiat del curs de Perl
 
Benvinguda al curs de Perl
Benvinguda al curs de PerlBenvinguda al curs de Perl
Benvinguda al curs de Perl
 
Orientació a objectes amb Moose
Orientació a objectes amb MooseOrientació a objectes amb Moose
Orientació a objectes amb Moose
 
Dades i operadors
Dades i operadorsDades i operadors
Dades i operadors
 
Programació orientada a objectes en Perl
Programació orientada a objectes en PerlProgramació orientada a objectes en Perl
Programació orientada a objectes en Perl
 
Cloenda del Curs d'introducció a Perl 2011
Cloenda del Curs d'introducció a Perl 2011Cloenda del Curs d'introducció a Perl 2011
Cloenda del Curs d'introducció a Perl 2011
 
Benvinguda al Curs d'introducció a Perl 2011
Benvinguda al Curs d'introducció a Perl 2011Benvinguda al Curs d'introducció a Perl 2011
Benvinguda al Curs d'introducció a Perl 2011
 
Modern Perl Toolchain
Modern Perl ToolchainModern Perl Toolchain
Modern Perl Toolchain
 
dh-make-perl
dh-make-perldh-make-perl
dh-make-perl
 

Último

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 

Último (20)

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 

REST in theory

  • 1. REST in theory by Alex Muntada / @alexmuntada
  • 2. What makes Internet a success? World Wide Web
  • 3. What makes the Web a success? easy customized linked pervasive
  • 5. Architectural Styles and the Design of Network-based Software Architectures Roy Fielding (2000)
  • 6. SOAP 1.2 W3C recommendation (2003)
  • 7. RESTful Web Services Leonard Richardson, Sam Ruby (2007)
  • 8. REST becomes a success
  • 9. RESTful Web APIs Leonard Richardson, Mike Amundsen, Sam Ruby (2013)
  • 10. REST(ful) “Representational state transfer (REST) is a software architectural style consisting of a coordinated set of architectural constraints applied to components, connectors, and data elements, within a distributed hypermedia system.”
  • 11. Architectural Properties of the Web Low Entry-Barrier (easy) Extensibility (customized) Distributed Hypermedia (linked) Internet-Scale (pervasive)
  • 12. Interface Constraints Identification of Resources (URIs) Manipulation of Resources Through Representations Self-Descriptive Messages (stateless) The Hypermedia Constraint (HATEOAS)
  • 13. HATEOAS “Hypermedia as the engine of application state.” All application state is kept on the client side. The client can only change it through HTTP requests and responses. The client can find next actions through hypermedia controls. Hypermedia controls drive changes in application state.
  • 14. Architectural Constraints Client-Server (one to one) Statelessness (application state, resource state) Caching (if-modified-since, if-match, 304) Uniform Interface Layered System (proxies, gateways) Code on Demand (javascript)
  • 15. APIs
  • 16. What is your worst nightmare in APIs? Documentation Bad, old, wrong or lack thereof.
  • 17. Twitter REST API v1.1 POST statuses/update Resource URL: https://api.twitter.com/1.1/statuses/update.json HTTP Methods: POST Response Formats: json Parameters: status (required), in_reply_to_status_id, lat, long, place_id, display_coordinates, trim_user
  • 18. What is missing in this example? POST /1.1/statuses/update.json HTTP/1.1 User-Agent: curl/7.35.0 Host: api.twitter.com Accept: */* Content-Length: 68 Content-Type: application/x-www-form-urlencoded status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk HTTP/1.1 400 Bad Request content-length: 61 content-type: application/json; charset=utf-8 date: Sun, 18 May 2014 19:30:43 UTC server: tfe set-cookie: guest_id=v1%3A140044144371735781; Domain=.twitter.com; Path=/; Expires=Tue, 17-May-2016 19:30:43 strict-transport-security: max-age=631138519 x-tfe-logging-request-category: API {"errors":[{"message":"Bad Authentication data","code":215}]}
  • 19. How can I fix it? POST /1.1/statuses/update.json HTTP/1.1 User-Agent: curl/7.35.0 Host: api.twitter.com Accept: */* Content-Length: 68 Content-Type: application/x-www-form-urlencoded Authorization: OAuth oauth_consumer_key="xvz1evFS4wEEPTGEFPHBog", oauth_nonce="kYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg", oauth_signature="tnnArxj06cWHq44gCs1OSKk%2FjLY%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1318622958", oauth_token="370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb", oauth_version="1.0" status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk
  • 20. How did I find that? Read several pages of documentation: 1. POST statuses/update 2. Application-user authentication 3. Using OAuth 4. Authorizing a request
  • 21. The Semantic Gap “The gap between the structure of a document and its real-world meaning—its application semantics. Media types, machine-readable profiles, and human-readable documentation bridge the semantic gap in different ways, but bridging the gap always requires the intervention of a human being at some point.” RESTful Web APIs, p. 360
  • 22. Final Thoughts Try to use less documentation and more hypermedia. Use existing standards, content types, link relations, etc. Propose new ones when there are none. Think about Internet-scale APIs. Let your APIs socialize with other APIs. Embrace the semantic challenge!
  • 23. Questions? by Alex Muntada / @alexmuntada