SlideShare a Scribd company logo
1 of 66
REST and HATEOAS



Ben Longden, PHPNW 2011
REST and the
Hypermedia Constraint



Ben Longden, PHPNW 2011
Who are you?
Who are you?
   @blongden
Who are you?
Who are you?
   @ibuildings
Who are you?
Who are you?
    @fdrop
REST
REpresentational State Transfer
REST
 Series of constraints for distributed
hypermedia systems - Roy Fielding, 2000
Constraints are good
Constraints are good
They (help) stop you from doing crazy
                things
REST is an Architecture
     It is not a protocol
Goals

Scalability

Generality of Interfaces

Independent deployment of components

Intermediaries to reduce latency,
enforce security, and encapsulate
legacy systems.
Client server
Stateless
Cache
Layered system
Code on demand
Uniform interface
Uniform interface
 Identification of resources
Uniform interface
Manipulations of resources through
          representations
Uniform interface
  Self descriptive messages
Uniform interface
Hypertext as the engine of application
                 state
The hypermedia
  constraint?
The hypermedia
      constraint
A URI request returns all valid state
               changes
The hypermedia
  constraint
 It’s how the web works
The hypermedia
  constraint
You already understand it!
HTTP
HTTP
Your browser speaks the language of
             text/html
<!DOCTYPE html>
HTML
Using hypermedia on the web, you can
   link to different types of data
HTML
Using hypermedia on the web, you can
   link to different types of data


 text/css image/png audio/mpeg
Hypermedia Types
 “Hypermedia Types are MIME media types
    that contain native hyper-linking
semantics that induce application flow.”
          - Mike Amundsen (2010)
The hypermedia
    constraint
The client tells the server what
       language it speaks
The hypermedia
       constraint
The server tells the client what to do
HTTP/1.1
HTTP/1.1
HEAD GET POST PUT DELETE TRACE OPTIONS
             CONNECT PATCH
GET and POST is OK
GET and POST is OK
REST doesn’t care what methods you use
GET and POST is OK
HTTP cares that the methods are used
              correctly
Life in XHTML
The website is also the API
Life in XHTML
Inconvenient and difficult to maintain
False start #1
Attempt a custom hypermedia type
False start #2
 application/atom+xml
False start #3
 application/xhtml+xml
Custom hypermedia types
  Consider registered types first
Custom hypermedia types
   More likely to be understood
A solution
application/vnd.fdrop.xhtml+xml
A solution
XHTML has hypermedia controls built in
A solution
Contains most of what I need
XML based media
     types
    Namespaces
Let’s see it then!
     @RESTConsole
What about JSON?
application/vnd.collection+json
      application/hal+json
Versioning
  http://www.w3.org/History/19921103-
hypertext/hypertext/WWW/TheProject.html
Versioning
The server makes no assumptions on the
      capabilities of the client
Versioning
 If the client does not support
something, it simply ignores it
Versioning
The web is not versioned
Versioning
Correct use of hypermedia means you can
change things without affecting clients
Versioning
But if you must...
Versioning
Accept: application/vnd.fdrop.v2.xhtml+xml
http://tools.ietf.org/html/rfc2616
http://tools.ietf.org/html/rfc4287
http://amundsen.com/hypermedia/
http://amundsen.com/media-types/collection/

http://www.flickr.com/photos/bjornmeansbear/4727475559/
http://joind.in/talk/view/3589

          @blongden

More Related Content

What's hot

Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web APIBrad Genereaux
 
Express JS Rest API Tutorial
Express JS Rest API TutorialExpress JS Rest API Tutorial
Express JS Rest API TutorialSimplilearn
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practicesAnkita Mahajan
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web ServicesAngelin R
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUDPrem Sanil
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsTessa Mero
 
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0Cory Forsyth
 
HTTP Request Header and HTTP Status Code
HTTP Request Header and HTTP Status CodeHTTP Request Header and HTTP Status Code
HTTP Request Header and HTTP Status CodeAbhishek L.R
 
Rest with java (jax rs) and jersey and swagger
Rest with java (jax rs) and jersey and swaggerRest with java (jax rs) and jersey and swagger
Rest with java (jax rs) and jersey and swaggerKumaraswamy M
 

What's hot (20)

RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Express JS Rest API Tutorial
Express JS Rest API TutorialExpress JS Rest API Tutorial
Express JS Rest API Tutorial
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practices
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
Api Testing
Api TestingApi Testing
Api Testing
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
 
Web services SOAP
Web services SOAPWeb services SOAP
Web services SOAP
 
HTTP Request Header and HTTP Status Code
HTTP Request Header and HTTP Status CodeHTTP Request Header and HTTP Status Code
HTTP Request Header and HTTP Status Code
 
Rest with java (jax rs) and jersey and swagger
Rest with java (jax rs) and jersey and swaggerRest with java (jax rs) and jersey and swagger
Rest with java (jax rs) and jersey and swagger
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Rest API
Rest APIRest API
Rest API
 
API Design- Best Practices
API Design-   Best PracticesAPI Design-   Best Practices
API Design- Best Practices
 

Viewers also liked

The Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTThe Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTBruno Kessler Foundation
 
RESTful services
RESTful servicesRESTful services
RESTful servicesgouthamrv
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 SlidesSuraj Gupta
 
HATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleHATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleApigee | Google Cloud
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developersPatrick Savalle
 

Viewers also liked (8)

The Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTThe Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReST
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
RESTful services
RESTful servicesRESTful services
RESTful services
 
Introduction To REST
Introduction To RESTIntroduction To REST
Introduction To REST
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
 
HATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleHATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API Style
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
REST Presentation
REST PresentationREST Presentation
REST Presentation
 

Similar to Rest and the hypermedia constraint

REST and the Hypermedia Constraint
REST and the Hypermedia ConstraintREST and the Hypermedia Constraint
REST and the Hypermedia ConstraintInviqa
 
internet principles of operation By ZAK
internet principles of operation By ZAKinternet principles of operation By ZAK
internet principles of operation By ZAKTabsheer Hasan
 
HTTP: the Other ESB
HTTP: the Other ESBHTTP: the Other ESB
HTTP: the Other ESBRyan Riley
 
Web technology-guide
Web technology-guideWeb technology-guide
Web technology-guideSrihari
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1hussulinux
 
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 springMuhammad Junaid Ansari
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009Cathie101
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009Cathie101
 
Web programming by Najeeb ullahAzad(1)
Web programming by Najeeb ullahAzad(1)Web programming by Najeeb ullahAzad(1)
Web programming by Najeeb ullahAzad(1)azadmcs
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsIdo Flatow
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfEngmohammedAlzared
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using PhpSudheer Satyanarayana
 
Lecture 1 Introduction to Web Development.pptx
Lecture 1 Introduction to Web Development.pptxLecture 1 Introduction to Web Development.pptx
Lecture 1 Introduction to Web Development.pptxKevi20
 

Similar to Rest and the hypermedia constraint (20)

REST and the Hypermedia Constraint
REST and the Hypermedia ConstraintREST and the Hypermedia Constraint
REST and the Hypermedia Constraint
 
internet principles of operation By ZAK
internet principles of operation By ZAKinternet principles of operation By ZAK
internet principles of operation By ZAK
 
HTTP: the Other ESB
HTTP: the Other ESBHTTP: the Other ESB
HTTP: the Other ESB
 
HTTP1.1/2 overview
HTTP1.1/2 overviewHTTP1.1/2 overview
HTTP1.1/2 overview
 
RESTful APIs
RESTful APIsRESTful APIs
RESTful APIs
 
Web
WebWeb
Web
 
Web technology-guide
Web technology-guideWeb technology-guide
Web technology-guide
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1
 
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
 
Http_Protocol.pptx
Http_Protocol.pptxHttp_Protocol.pptx
Http_Protocol.pptx
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Web programming by Najeeb ullahAzad(1)
Web programming by Najeeb ullahAzad(1)Web programming by Najeeb ullahAzad(1)
Web programming by Najeeb ullahAzad(1)
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdf
 
Web server
Web serverWeb server
Web server
 
0130225347
01302253470130225347
0130225347
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
 
Lecture 1 Introduction to Web Development.pptx
Lecture 1 Introduction to Web Development.pptxLecture 1 Introduction to Web Development.pptx
Lecture 1 Introduction to Web Development.pptx
 
11 asp.net web api
11 asp.net web api11 asp.net web api
11 asp.net web api
 

Recently uploaded

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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Rest and the hypermedia constraint

Editor's Notes

  1. \n
  2. \n
  3. Developer for 20 years\nProfessional developer since 2002\nStarted on C, C++ and Perl\nFocussed on Perl and moved into web app development where I picked up PHP\nmobile web, standards and software architectures\n
  4. Technical Team Lead since the start of 2010\nOne of the Sheffield office founders\n
  5. Sole developer of fdrop.it\nCreated to solve my problem of &amp;#x2018;why is it so difficult to send a file to someone online?&amp;#x2019;\n
  6. \n
  7. \n
  8. Doctoral Dissertation\n&amp;#x2018;Architectural Styles and the Design of Network-based Software Architectures&amp;#x2019;\n\none of the principle author of HTTP specification (RFC 1945/2616)\nIn 1999 he was named my MIT Technology Review as one of the top 100 innovators in the world under 35\n\n\n
  9. \n
  10. Constraints help to guide the creative project\n\nSacrifice is usually made retroactively\n
  11. Can be applied to ANY distributed system\nWeb application or API design\n
  12. \n
  13. Clients not concerned about data storage\nServers not concerned about the user interface or user state\ncomponents evolve independently if interface remains constant\n
  14. Each request from the client must contain ALL of the information required\nCannot rely on stored context on the server\nSession state on the client\nVisibility (Server can be observed at any time), Reliability (network failure), Scalability (easy to add servers)\n
  15. Responses must implicitly or explicitly define themselves as cacheable or not\nFurther improves scalability and performance\n\n
  16. Client connected to the end server or to an intermediary along the way.\nLoad Balancers\nSecurity Policies at a Firewall\nReverse Proxy Cache\n\n
  17. Service can temporarily extend client side functionality by providing code it can execute \nie, Javascript or java applets\n\nTHE OPTIONAL CONSTRAINT!\n
  18. Four guiding principles to simplify architecture\n
  19. On the web we use URI&amp;#x2019;s\n\nResources themselves are usually different to what is returned to the client\nUsually, a database resource will be represented in JSON or XML\n
  20. When a client holds a representation, it is enough to be able to modify or delete the resource assuming the user has permission to do so\n
  21. Each message describes itself. This means using an explicit mime type, and explicitly if the resource can be cached.\n
  22. Clients make state transitions ONLY through links returned within the resource (ie, anchors in html)\n\nOnly exception is the entry point\n
  23. HATEOAS is a horrible acronym\n
  24. Using hypermedia (anchor, xlink, etc)\n
  25. and it&amp;#x2019;s why it&amp;#x2019;s been so successful over the last 20 years. The web is 20 years old. That&amp;#x2019;s amazing - and because of standards and hypermedia, I can still reference things from 20 years ago.\n
  26. A web page contains all the information within it to allow the user to move from the current state, to the next.\n
  27. All types of HTML\nXHTML\n\nVersions within them are identified by the content (DOCTYPE, html tag or xml header)\nXML documents not processed as XML (no checks for well formedness)\n \n
  28. HTML 5 won over XHTML for who gains supremacy over the browsers - HTML contains some really good stuff about describing text, images, user input etc and what HTTP function to use on them (ie, GET image, POST a form).\n
  29. This is how you declare an html 5 document. It&amp;#x2019;s great for the web as browsers only need to understand GET and POST - this is fine and it&amp;#x2019;s still RESTful, but what if we need a representation of a resource that can support other actions?\n
  30. \n
  31. HTML is a hypermedia type\nXML is not\n
  32. Accept header in HTTP\n
  33. HTTP headers and Hypermedia!\n
  34. \nHTTP 1.1 defines these 9 methods. HTML lets us use 2 of them. \n
  35. That&amp;#x2019;s all you get in a browser\n\n
  36. \n
  37. GET to retrive, POST to create, PUT to update, DELETE\nPOST to a job queue to update and delete\nThese are HTTP, not REST (REST just defines the uniform interface)\n
  38. API for free?\nDownsides\nSome actions need to be different over an API due to different UI\nAJAX\n
  39. Focus on the UI breaks the API\n
  40. Craft my own XML doc\nNeed to define my media type first\nToo much like work...\n
  41. There was merit to this - which i&amp;#x2019;ll come back to\n
  42. Remove the markup from the XHTML that was only there to layout the UI\nServe HTML5 to browsers on text/html!\nClose - but webkit on iOS and Android devices prefer XML\n
  43. \n
  44. \n
  45. XHTML still in the media type so still self describing\nWont conflict with browsers\n\n
  46. \n\n
  47. form, input, img, a\nBrowsers already understand XHTML\nEasy for people to consume using any XML Reader\nDEMO\n
  48. XHTML only supports GET and POST\nWhat if we need more?\n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n