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

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

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.