SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
REST

Representational State Transfer
whoami

Colin Harrington
 ● colin.harrington@objectpartners.com
 ● colin@colinharrington.net
 ● http://colinharrington.net
 ● @ColinHarrington
History

HTTP :: HyperText Transfer Protocol
Tim Berners-Lee :: 1990s

Foundations of the Web

OSI Layer 7
Application Layer


Protocol
History

REST :: Representational State Transfer

2000 Doctoral Dissertation by Roy T. Fielding
http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

"Roy Thomas Fielding (born 1965) is an American computer
scientist[1], one of the principal authors of the HTTP specification, an
authority on computer network architecture[2] and co-founder of the
Apache HTTP Server project." (Wikipedia)
http://roy.gbiv.com/

@fielding
History - REST
Architecture:
 ● Client-Server
 ● Stateless + Cacheable
 ● Uniform Interface + Layerable

Data:
 ● Resources, identifiers & metadata
 ● Representation & metadata
 ● Control Data { headers }

Elements:
 ● {clients, server, resolver, cache}
 ● Gateways, proxies, user agents
 ● URL, URI, Schemes
REST

REST is a buzzword and a movement but it symbolizes a coherent
usage of the web (HTTP) as it was designed




            REST ~ HTTP done right.
Resources

Uniform Resource Identifiers (URI)

       <scheme>:<scheme-specified-structure>

 ● ftp://example.org/resource.txt
 ● urn:issn:1535-3613
 ● mailto:colin@colinharrington.net


Uniform Resource Locator (URL)

            scheme://domain:port/path?query_string
HTTP Methods/Verbs

HEAD, GET, OPTIONS => considered "safe"
PUT, POST, DELETE => possibly destructive
TRACE, DEBUG => Considered harmful


curl -v http://www.google.com

GET / HTTP/1.1
User-Agent: curl/7.21.0
Host: www.google.com
Accept: */*
Accept Headers :: Client

GET / HTTP/1.1
User-Agent: curl/7.21.0
Host: www.google.com
Accept: */*


Accept: application/xml


Accept: text/html,application/xhtml+xml,
application/xml;q=0.9,*/*;q=0.8,
application/json
HTTP Status Codes

200 - OK
301 - Moved permanently
302 - Moved temporarily
404 - Not Found
500
            http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

HTTP/1.1 200 OK
Date: Mon, 31 Oct 2011 16:07:53 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
http://homestarrunner.com/404d
Representations

                    JSON Example
 ● XML              {
                         "firstName": "John",
                         "lastName" : "Smith",
                         "age"       : 25,
 ● JSON                  "address" :
                         {
                             "streetAddress": "21 2nd Street",
                             "city"          : "New York",
 ● HTML                      "state"         : "NY",
                             "postalCode"    : "10021"
                         },
                         "phoneNumber":
 ● XHTML                 [
                             {
                                "type" : "home",
                                "number": "212 555-1234"
 ● RDF                       },
                             {
                                "type" : "fax",
                                "number": "646 555-4567"
 ● Text                  ]
                             }

                      }

 ● Custom Formats
Content Negotiation

Request:
Accept Header
 Accept: application/xml

Accept-Language
Accept-Encoding

Response:
Content-Type: text/json

Accept: text/html,application/xhtml+xml,
application/xml;q=0.9,*/*;q=0.8,
application/json
Cacheability

HTTP Cache Headers

 ● Expires
 ● Cache-Control
 ● ETag
 ● Last-Modified
 ● Pragma no-cache

Proxy & Network path.
CRUD

                                            Create :: POST

                                              Read :: GET

                                             Update :: PUT

                                         Delete :: DELETE




* http://stackoverflow.com/questions/630453/put-vs-post-in-rest
Hypermedia

Linking
          to other resources / media

HTML documents, resources
loosely coupled
Images, CSS, favicon, etc.




Like this image ->
http://cuip.uchicago.edu/~cac/images/Hypermedia.jpg
Who

http://www.programmableweb.com/

Amazon Web Services
 {S3, EC2, SQS, RDS, FPS, etc.}




Just to name a few...
Resources
This guy explains REST in to his non-technical wife:
http://tomayko.com/writings/rest-to-my-wife

Good article on how to REST with curl:
http://blogs.plexibus.com/2009/01/15/rest-esting-with-curl/

Poster -- the Firefox plugin:
https://addons.mozilla.org/en-US/firefox/addon/poster/

You'd probably learn best by actually making some RESTful
calls. Pick a service that is free and RESTful and play around with it. I'd
recommend using http://www.twilio.com/ just because they offer you
$30 in free credit and you get to make, receive and control real phone
calls.
Thank You

Mais conteúdo relacionado

Mais procurados

Altitude SF 2017: Privacy protection by proxy
Altitude SF 2017: Privacy protection by proxyAltitude SF 2017: Privacy protection by proxy
Altitude SF 2017: Privacy protection by proxyFastly
 
Mongo DB schema design patterns
Mongo DB schema design patternsMongo DB schema design patterns
Mongo DB schema design patternsjoergreichert
 
MongoDB Mojo: Building a Basic Perl App
MongoDB Mojo: Building a Basic Perl AppMongoDB Mojo: Building a Basic Perl App
MongoDB Mojo: Building a Basic Perl AppStennie Steneker
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source BridgeChris Anderson
 
OpenSearch 2010-09
OpenSearch 2010-09OpenSearch 2010-09
OpenSearch 2010-09Oscar Fonts
 
Mongo db datatypes
Mongo db datatypesMongo db datatypes
Mongo db datatypeszarigatongy
 
Jsonp null-meet-02-2015
Jsonp null-meet-02-2015Jsonp null-meet-02-2015
Jsonp null-meet-02-2015Sunil Kumar
 
Using historical open data for family history - and the value of GB1900 data
Using historical open data for family history - and the value of GB1900 dataUsing historical open data for family history - and the value of GB1900 data
Using historical open data for family history - and the value of GB1900 dataTom Pert
 
Introduction to MongoDB for C# developers
Introduction to MongoDB for C# developersIntroduction to MongoDB for C# developers
Introduction to MongoDB for C# developersTaras Romanyk
 

Mais procurados (13)

Altitude SF 2017: Privacy protection by proxy
Altitude SF 2017: Privacy protection by proxyAltitude SF 2017: Privacy protection by proxy
Altitude SF 2017: Privacy protection by proxy
 
Mongo DB schema design patterns
Mongo DB schema design patternsMongo DB schema design patterns
Mongo DB schema design patterns
 
MongoDB FabLab León
MongoDB FabLab LeónMongoDB FabLab León
MongoDB FabLab León
 
JSOP in 60 seconds
JSOP in 60 secondsJSOP in 60 seconds
JSOP in 60 seconds
 
MongoDB Mojo: Building a Basic Perl App
MongoDB Mojo: Building a Basic Perl AppMongoDB Mojo: Building a Basic Perl App
MongoDB Mojo: Building a Basic Perl App
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source Bridge
 
OpenSearch 2010-09
OpenSearch 2010-09OpenSearch 2010-09
OpenSearch 2010-09
 
Mongo db datatypes
Mongo db datatypesMongo db datatypes
Mongo db datatypes
 
Gopher Vs HTTP
Gopher Vs HTTPGopher Vs HTTP
Gopher Vs HTTP
 
Jsonp null-meet-02-2015
Jsonp null-meet-02-2015Jsonp null-meet-02-2015
Jsonp null-meet-02-2015
 
MongoDB
MongoDBMongoDB
MongoDB
 
Using historical open data for family history - and the value of GB1900 data
Using historical open data for family history - and the value of GB1900 dataUsing historical open data for family history - and the value of GB1900 data
Using historical open data for family history - and the value of GB1900 data
 
Introduction to MongoDB for C# developers
Introduction to MongoDB for C# developersIntroduction to MongoDB for C# developers
Introduction to MongoDB for C# developers
 

Semelhante a Brief Introduction to REST

HTTP protocol and Streams Security
HTTP protocol and Streams SecurityHTTP protocol and Streams Security
HTTP protocol and Streams SecurityBlueinfy Solutions
 
Introducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemIntroducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemAndrew Liu
 
FIWARE Global Summit - Hands-On NGSI-LD
FIWARE Global Summit - Hands-On NGSI-LDFIWARE Global Summit - Hands-On NGSI-LD
FIWARE Global Summit - Hands-On NGSI-LDFIWARE
 
R-Users Group JSON and ReST Introduction using Twitter
R-Users Group JSON and ReST Introduction using TwitterR-Users Group JSON and ReST Introduction using Twitter
R-Users Group JSON and ReST Introduction using TwitterKevin Smith
 
Consuming RESTful Web services in PHP
Consuming RESTful Web services in PHPConsuming RESTful Web services in PHP
Consuming RESTful Web services in PHPZoran Jeremic
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHPZoran Jeremic
 
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers ProgramSession 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers ProgramFIWARE
 
FIWARE Training: JSON-LD and NGSI-LD
FIWARE Training: JSON-LD and NGSI-LDFIWARE Training: JSON-LD and NGSI-LD
FIWARE Training: JSON-LD and NGSI-LDFIWARE
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web ArchitectureChamnap Chhorn
 
Data integration
Data integrationData integration
Data integrationBallerina
 
Design Web Service API by HungerStation
Design Web Service API by HungerStationDesign Web Service API by HungerStation
Design Web Service API by HungerStationArabNet ME
 
Comparison with storing data using NoSQL(CouchDB) and a relational database.
Comparison with storing data using NoSQL(CouchDB) and a relational database.Comparison with storing data using NoSQL(CouchDB) and a relational database.
Comparison with storing data using NoSQL(CouchDB) and a relational database.eross77
 
[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyondCarles Farré
 
Alexander Sibiryakov- Frontera
Alexander Sibiryakov- FronteraAlexander Sibiryakov- Frontera
Alexander Sibiryakov- FronteraPyData
 
Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2kriszyp
 
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache CamelOpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache CamelJosé Román Martín Gil
 
JSON-LD and NGSI-LD
JSON-LD and NGSI-LDJSON-LD and NGSI-LD
JSON-LD and NGSI-LDFIWARE
 
JSON Fuzzing: New approach to old problems
JSON Fuzzing: New  approach to old problemsJSON Fuzzing: New  approach to old problems
JSON Fuzzing: New approach to old problemstitanlambda
 

Semelhante a Brief Introduction to REST (20)

HTTP protocol and Streams Security
HTTP protocol and Streams SecurityHTTP protocol and Streams Security
HTTP protocol and Streams Security
 
Introducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemIntroducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No Problem
 
FIWARE Global Summit - Hands-On NGSI-LD
FIWARE Global Summit - Hands-On NGSI-LDFIWARE Global Summit - Hands-On NGSI-LD
FIWARE Global Summit - Hands-On NGSI-LD
 
R-Users Group JSON and ReST Introduction using Twitter
R-Users Group JSON and ReST Introduction using TwitterR-Users Group JSON and ReST Introduction using Twitter
R-Users Group JSON and ReST Introduction using Twitter
 
Consuming RESTful Web services in PHP
Consuming RESTful Web services in PHPConsuming RESTful Web services in PHP
Consuming RESTful Web services in PHP
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
 
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers ProgramSession 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
 
FIWARE Training: JSON-LD and NGSI-LD
FIWARE Training: JSON-LD and NGSI-LDFIWARE Training: JSON-LD and NGSI-LD
FIWARE Training: JSON-LD and NGSI-LD
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web Architecture
 
Data integration
Data integrationData integration
Data integration
 
Os Gottfrid
Os GottfridOs Gottfrid
Os Gottfrid
 
Design Web Service API by HungerStation
Design Web Service API by HungerStationDesign Web Service API by HungerStation
Design Web Service API by HungerStation
 
Comparison with storing data using NoSQL(CouchDB) and a relational database.
Comparison with storing data using NoSQL(CouchDB) and a relational database.Comparison with storing data using NoSQL(CouchDB) and a relational database.
Comparison with storing data using NoSQL(CouchDB) and a relational database.
 
[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond
 
Alexander Sibiryakov- Frontera
Alexander Sibiryakov- FronteraAlexander Sibiryakov- Frontera
Alexander Sibiryakov- Frontera
 
Json at work overview and ecosystem-v2.0
Json at work   overview and ecosystem-v2.0Json at work   overview and ecosystem-v2.0
Json at work overview and ecosystem-v2.0
 
Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2
 
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache CamelOpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
 
JSON-LD and NGSI-LD
JSON-LD and NGSI-LDJSON-LD and NGSI-LD
JSON-LD and NGSI-LD
 
JSON Fuzzing: New approach to old problems
JSON Fuzzing: New  approach to old problemsJSON Fuzzing: New  approach to old problems
JSON Fuzzing: New approach to old problems
 

Último

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Último (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Brief Introduction to REST

  • 2. whoami Colin Harrington ● colin.harrington@objectpartners.com ● colin@colinharrington.net ● http://colinharrington.net ● @ColinHarrington
  • 3. History HTTP :: HyperText Transfer Protocol Tim Berners-Lee :: 1990s Foundations of the Web OSI Layer 7 Application Layer Protocol
  • 4. History REST :: Representational State Transfer 2000 Doctoral Dissertation by Roy T. Fielding http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm "Roy Thomas Fielding (born 1965) is an American computer scientist[1], one of the principal authors of the HTTP specification, an authority on computer network architecture[2] and co-founder of the Apache HTTP Server project." (Wikipedia) http://roy.gbiv.com/ @fielding
  • 5. History - REST Architecture: ● Client-Server ● Stateless + Cacheable ● Uniform Interface + Layerable Data: ● Resources, identifiers & metadata ● Representation & metadata ● Control Data { headers } Elements: ● {clients, server, resolver, cache} ● Gateways, proxies, user agents ● URL, URI, Schemes
  • 6. REST REST is a buzzword and a movement but it symbolizes a coherent usage of the web (HTTP) as it was designed REST ~ HTTP done right.
  • 7. Resources Uniform Resource Identifiers (URI) <scheme>:<scheme-specified-structure> ● ftp://example.org/resource.txt ● urn:issn:1535-3613 ● mailto:colin@colinharrington.net Uniform Resource Locator (URL) scheme://domain:port/path?query_string
  • 8. HTTP Methods/Verbs HEAD, GET, OPTIONS => considered "safe" PUT, POST, DELETE => possibly destructive TRACE, DEBUG => Considered harmful curl -v http://www.google.com GET / HTTP/1.1 User-Agent: curl/7.21.0 Host: www.google.com Accept: */*
  • 9. Accept Headers :: Client GET / HTTP/1.1 User-Agent: curl/7.21.0 Host: www.google.com Accept: */* Accept: application/xml Accept: text/html,application/xhtml+xml, application/xml;q=0.9,*/*;q=0.8, application/json
  • 10. HTTP Status Codes 200 - OK 301 - Moved permanently 302 - Moved temporarily 404 - Not Found 500 http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html HTTP/1.1 200 OK Date: Mon, 31 Oct 2011 16:07:53 GMT Expires: -1 Cache-Control: private, max-age=0 Content-Type: text/html; charset=ISO-8859-1
  • 12. Representations JSON Example ● XML { "firstName": "John", "lastName" : "Smith", "age" : 25, ● JSON "address" : { "streetAddress": "21 2nd Street", "city" : "New York", ● HTML "state" : "NY", "postalCode" : "10021" }, "phoneNumber": ● XHTML [ { "type" : "home", "number": "212 555-1234" ● RDF }, { "type" : "fax", "number": "646 555-4567" ● Text ] } } ● Custom Formats
  • 13. Content Negotiation Request: Accept Header Accept: application/xml Accept-Language Accept-Encoding Response: Content-Type: text/json Accept: text/html,application/xhtml+xml, application/xml;q=0.9,*/*;q=0.8, application/json
  • 14. Cacheability HTTP Cache Headers ● Expires ● Cache-Control ● ETag ● Last-Modified ● Pragma no-cache Proxy & Network path.
  • 15. CRUD Create :: POST Read :: GET Update :: PUT Delete :: DELETE * http://stackoverflow.com/questions/630453/put-vs-post-in-rest
  • 16. Hypermedia Linking to other resources / media HTML documents, resources loosely coupled Images, CSS, favicon, etc. Like this image -> http://cuip.uchicago.edu/~cac/images/Hypermedia.jpg
  • 17. Who http://www.programmableweb.com/ Amazon Web Services {S3, EC2, SQS, RDS, FPS, etc.} Just to name a few...
  • 18. Resources This guy explains REST in to his non-technical wife: http://tomayko.com/writings/rest-to-my-wife Good article on how to REST with curl: http://blogs.plexibus.com/2009/01/15/rest-esting-with-curl/ Poster -- the Firefox plugin: https://addons.mozilla.org/en-US/firefox/addon/poster/ You'd probably learn best by actually making some RESTful calls. Pick a service that is free and RESTful and play around with it. I'd recommend using http://www.twilio.com/ just because they offer you $30 in free credit and you get to make, receive and control real phone calls.