SlideShare a Scribd company logo
1 of 42
ReST you’re doing it wrong! Sergey ShishkinMT AG http://www.mt-ag.comhttp://shishkin.org @sshishkin
ReST you’re doing it wrong! Sergey ShishkinMT AG http://www.mt-ag.comhttp://shishkin.org @sshishkin
A Tale of an Ice-Cream Maker by SebastienLambla
Architecture of the web
Loose Coupling
Simplicity,Uniformity
Scalability,Performance
You MightNot Need It
Which URI is RESTful? /products/books/can-haz-rest /products ? title=can-haz-rest /Y2FuLWhhei1yZXN0%3D
POST /REST.svc<PlaceOrder>  <Product> 1234 </Product>  <Price> 19.90 </Price>  <Qty> 2 </Qty></PlaceOrder>
POST /REST.svc{PlaceOrder: {    Product: 1234,    Price: 19.90,    Quantity: 2  }}
Richardson RESTMaturity Model None
GET /REST.svc ?  op=PlaceOrder &  product=1234 &qty=2
URI Tunneling
POST /Orders.svc ?  product=1234 &qty=2
GETidempotent,safe POSTnon idempotent, unsafe PUTidempotent, unsafe DELETEidempotent, unsafe HEADidempotent,safe OPTIONSidempotent,safe
GET /Users/1234…PUT /Users/1234{  login: bob, …userpic: {…},  settings: {…}}
Resourcesare notEntities
CRUD
CRUD
GET /Profile/SettingsPOST /Profile/SettingsPOST /Profile/Image
URI Templates /products/{id}
Richardson RESTMaturity Model URI None
Versioning /api/v2
GET /api Accept:  application/vnd.example+xml;    version=2,  application/xml
Languages /de/product/1234/product/1234 ? lang=fr
GET /product/1234 Accept-Language: de
Richardson RESTMaturity Model HTTP URI None
GET /Products/1234…Content-Type: application/json{  title: can-haz-rest,  price: 19.99,  …}
Generic Media Types
application/atom+xml;type=feed application/vnd.example+json
GET /Products/1234{  title: can-haz-rest,  price: 19.99,} And What Now?
{  title: “can-haz-rest”,  links: [    {rel: “buy”,      link: “Product/1234/buy”    }  ]}
Richardson RESTMaturity Model Hypermedia HTTP URI None
It’s all about resources,
Representations,
And Hypermedia!
It’s All About Resources, Representations, And Hypermedia!
Application Lifecycle Design Entwicklung BeratungProjekteSchulungen Architektur SOA Cloud Computing BalckeBalcke-Dürr-Allee 9, 40882 Ratingen www.mt-ag.com info@mt-ag.com
Sergey Shishkin http://shishkin.org sergei.shishkin@gmail.com @sshishkin
Links & Credits Richardson Maturity Model http://martinfowler.com/articles/richardsonMaturityModel.html The Tale of the Ice-Cream Maker http://serialseb.blogspot.com/2009/06/fighting-for-rest-or-tale-of-ice-cream.html REST in Practice http://restinpractice.com/ REST Content on InfoQ http://www.infoq.com/rest/ Images: Web: http://www.flickr.com/photos/zzathras777/1546040168/ Mirrors: http://www.flickr.com/photos/coolmikeol/4156970741/ Rope: http://www.flickr.com/photos/visualpanic/2759322646/ Soup: http://www.flickr.com/photos/wallyg/562283586/ Ice-cream van: http://www.flickr.com/photos/estherase/516542355/ Ice-cream: http://www.flickr.com/photos/pinksherbet/3398923323/

More Related Content

Similar to REST - You're Doing It Wrong

Monitoring your electricity usage
Monitoring your electricity usageMonitoring your electricity usage
Monitoring your electricity usageDale Lane
 
Creating Responsive Experiences
Creating Responsive ExperiencesCreating Responsive Experiences
Creating Responsive ExperiencesTim Kadlec
 
High Performance Kick Ass Web Apps (JavaScript edition)
High Performance Kick Ass Web Apps (JavaScript edition)High Performance Kick Ass Web Apps (JavaScript edition)
High Performance Kick Ass Web Apps (JavaScript edition)Stoyan Stefanov
 
2009 Java One State Of The Open Web
2009 Java One State Of The Open Web2009 Java One State Of The Open Web
2009 Java One State Of The Open WebPatrick Chanezon
 
DNS May Be Hazardous to Your Health
DNS May Be Hazardous to Your HealthDNS May Be Hazardous to Your Health
DNS May Be Hazardous to Your HealthRobert Stucke
 
Jade & Javascript templating
Jade & Javascript templatingJade & Javascript templating
Jade & Javascript templatingwearefractal
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone InteractivityEric Steele
 
From jQuery to App Store in 30 Minutes
From jQuery to App Store in 30 MinutesFrom jQuery to App Store in 30 Minutes
From jQuery to App Store in 30 Minutesedill3484
 
Flickr Open Api Mashup
Flickr Open Api MashupFlickr Open Api Mashup
Flickr Open Api MashupJinho Jung
 
How to make Google Books at home
How to make Google Books at homeHow to make Google Books at home
How to make Google Books at homeAndrew Shitov
 
What is bilateral circuit
What is bilateral circuitWhat is bilateral circuit
What is bilateral circuitSindhoo Oad
 
What is bilateral circuit
What is bilateral circuitWhat is bilateral circuit
What is bilateral circuitSindhoo Oad
 
Ruby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start UpRuby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start UpPrateek Saxena
 
HTML5 - techMaine Presentation 5/18/09
HTML5 - techMaine Presentation 5/18/09HTML5 - techMaine Presentation 5/18/09
HTML5 - techMaine Presentation 5/18/09pemaquid
 
Things you probably don't do (or tying to make project automation sexy)
Things you probably don't do (or tying to make project automation sexy)Things you probably don't do (or tying to make project automation sexy)
Things you probably don't do (or tying to make project automation sexy)Gareth Rushgrove
 

Similar to REST - You're Doing It Wrong (20)

Monitoring your electricity usage
Monitoring your electricity usageMonitoring your electricity usage
Monitoring your electricity usage
 
Creating Responsive Experiences
Creating Responsive ExperiencesCreating Responsive Experiences
Creating Responsive Experiences
 
High Performance Kick Ass Web Apps (JavaScript edition)
High Performance Kick Ass Web Apps (JavaScript edition)High Performance Kick Ass Web Apps (JavaScript edition)
High Performance Kick Ass Web Apps (JavaScript edition)
 
2009 Java One State Of The Open Web
2009 Java One State Of The Open Web2009 Java One State Of The Open Web
2009 Java One State Of The Open Web
 
Http
HttpHttp
Http
 
Libro de SAP BUSINESS DIGITAL.pdf
Libro de SAP BUSINESS DIGITAL.pdfLibro de SAP BUSINESS DIGITAL.pdf
Libro de SAP BUSINESS DIGITAL.pdf
 
DNS May Be Hazardous to Your Health
DNS May Be Hazardous to Your HealthDNS May Be Hazardous to Your Health
DNS May Be Hazardous to Your Health
 
Jade & Javascript templating
Jade & Javascript templatingJade & Javascript templating
Jade & Javascript templating
 
Front End on Rails
Front End on RailsFront End on Rails
Front End on Rails
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone Interactivity
 
andltorre
andltorreandltorre
andltorre
 
From jQuery to App Store in 30 Minutes
From jQuery to App Store in 30 MinutesFrom jQuery to App Store in 30 Minutes
From jQuery to App Store in 30 Minutes
 
Flickr Open Api Mashup
Flickr Open Api MashupFlickr Open Api Mashup
Flickr Open Api Mashup
 
Negiotiable act
Negiotiable actNegiotiable act
Negiotiable act
 
How to make Google Books at home
How to make Google Books at homeHow to make Google Books at home
How to make Google Books at home
 
What is bilateral circuit
What is bilateral circuitWhat is bilateral circuit
What is bilateral circuit
 
What is bilateral circuit
What is bilateral circuitWhat is bilateral circuit
What is bilateral circuit
 
Ruby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start UpRuby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start Up
 
HTML5 - techMaine Presentation 5/18/09
HTML5 - techMaine Presentation 5/18/09HTML5 - techMaine Presentation 5/18/09
HTML5 - techMaine Presentation 5/18/09
 
Things you probably don't do (or tying to make project automation sexy)
Things you probably don't do (or tying to make project automation sexy)Things you probably don't do (or tying to make project automation sexy)
Things you probably don't do (or tying to make project automation sexy)
 

More from Sergey Shishkin

Scaling Engineering Organizations with Patterns
Scaling Engineering Organizations with PatternsScaling Engineering Organizations with Patterns
Scaling Engineering Organizations with PatternsSergey Shishkin
 
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingSergey Shishkin
 
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingSergey Shishkin
 
Specification by Example
Specification by ExampleSpecification by Example
Specification by ExampleSergey Shishkin
 
Asynchronous Messaging @DNUG Cologne, 07.04.2009
Asynchronous Messaging @DNUG Cologne, 07.04.2009Asynchronous Messaging @DNUG Cologne, 07.04.2009
Asynchronous Messaging @DNUG Cologne, 07.04.2009Sergey Shishkin
 

More from Sergey Shishkin (8)

Scaling Engineering Organizations with Patterns
Scaling Engineering Organizations with PatternsScaling Engineering Organizations with Patterns
Scaling Engineering Organizations with Patterns
 
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional Programming
 
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional Programming
 
NOSQL - not only sql
NOSQL - not only sqlNOSQL - not only sql
NOSQL - not only sql
 
Specification by Example
Specification by ExampleSpecification by Example
Specification by Example
 
NOSQL in the Cloud
NOSQL in the CloudNOSQL in the Cloud
NOSQL in the Cloud
 
Orthogonal Architecture
Orthogonal ArchitectureOrthogonal Architecture
Orthogonal Architecture
 
Asynchronous Messaging @DNUG Cologne, 07.04.2009
Asynchronous Messaging @DNUG Cologne, 07.04.2009Asynchronous Messaging @DNUG Cologne, 07.04.2009
Asynchronous Messaging @DNUG Cologne, 07.04.2009
 

Recently uploaded

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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
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
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
#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
 

Recently uploaded (20)

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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
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
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
#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
 

REST - You're Doing It Wrong

Editor's Notes

  1. Why should we care about what REST really is?“Once upon a time, in the age of fairies and leprechauns, an ice-cream maker named Roy Fielding discovered a seed that people have been using in a remote land, called cacao. Keen on using that discovery, he mixed those seeds with sugar, milk, eggs, cream and sugar and got the inhabitants of his village to try it.Everybody was excited about this new ice-cream. They all knew the ingredients of course, and some of them were using it, but the mixing of all of them in one ice-cream was somewhat a revelation for many. Villagers became very fond of that new ice-cream, and Roy decided to call it chocolate ice-cream. For a long time, many people in Roy’s village consumed chocolate ice-cream, and all was good in the world. That village was named Web and declared chocolate ice-cream it’s local speciality.One day, a traveller from the village of Soap, that everybody was calling mister Sainsbury, came to the village of Web and saw how much people liked that chocolate ice-cream. You see, in the Soap village, the local dish was made of soap, and people didn’t like soap very much. He decided to bring back the idea in his own village.Sainsbury tried to reproduce an ice-cream people would like, and put milk, eggs and sugar, but because he didn’t know about cacao, he decided to use vanilla POD instead. And he got his fellow villagers to try the ice-cream, and they all liked the ice-cream very much, all all was good in the world. And it was named chocolate ice-cream.Mister Sainsbury knew that the rest of the country was still eating soap, and decided, as a good business man he was, that they should all enjoy his chocolate ice-cream. And as mister Sainsbury got so rich from selling soap before, he started promoting his new chocolate ice-cream in the whole country, and soon all were excited about eating chocolate ice-cream made of vanilla.One day, an engineer from the village of Wikipedia came to Web and asked for the national desert, the chocolate ice-cream. The villagers happily provided him with a wonderful cocoa-based chocolate ice-cream. When the engineer started eating it, he started screaming:Engineer - This is not chocolate ice-cream! It’s not even the right colour! Do you think I’m a fool?Roy – This is chocolate ice-cream. It has cacao in it, as it always had.Engineer – No nono! Chocolate ice-cream is made of vanilla! Everybody knows that!Roy – No, it’s made of chocolate, if you put vanilla in it it’s vanilla ice-cream, because there’s no chocolate in it?Engineer – You’re just an extremist, you’re trying to confuse us!Roy – …And that’s when the villagers of Web decided that it was time for them to travel the country, and explain to people the advantages of putting cacao in their chocolate ice-creams.”
  2. REST is a set of underlying architectural constraints of the Web – the largest informational system ever built, yet simple and scalable.Fielding’s dissertation is a scientific paper and thus is not particularly easy to understand and start learning REST.We start with the goals of the web architecture, that REST constraints are aimed to lead to.Further we evaluate common techniques, used by so called (and often self-proclaimed) RESTful services, against contributing to those goals.The goals are:
  3. Web applications are designed to be loose coupled.The web could not ever be deployed as a monolith system.The web is an ever-growing ecosystem of loosely coupled servers, clients and intermediaries.Servers go down, go up or get updated – web still works.
  4. The Web have traded feature-richness for simplicity and uniformity.More intermediaries can implement simple and uniform protocol (HTTP) in order to provide features to servers and clients.
  5. Web caching at the proxy-level is an example of a high performance achieved due to the web’s uniform interface.Stateless nature of HTTP makes it ultimately scalable as well.
  6. Some don’t like chocolate ice-cream.Not everyone needs loose coupling and scalability taken to such an extreme.Not everyone has to build HTTP-based systems RESTful.Do whatever your system needs most. Just don’t call it REST if it’s not.
  7. Which URI is (more?) RESTful?Many developers start designing web APIs with URLs and ask on forums “how to design RESTful URLs?”This question is nonsense.The Web treats URL opaque.Some websites use so called “hackable” or “guessable” URLs for SEO purposes and to allow users overcome some usability issues.“Hackable” URLs have nothing to do with REST.
  8. Is it REST?No SOAP, no WSDL, no XML namespaces. It should be REST, right?
  9. Is this REST?We got JSON. JSON is RESTful, right?
  10. No. Previous examples tunnel requests through a single URL, burying business logic in the request body.From the web’s perspective these are not at all better than a good old WS-* SOAP service.We are still on the lowest level of the Richardson REST Maturity Model.We need resources in order to get a higher rank.
  11. Now we have an awesome resource. Is it REST now?
  12. The previous example did what is called “URL tunneling” – it passes all data, required for the request, in the URL.
  13. This one still uses URL tunneling, but it more accurately chooses the HTTP method.
  14. All the HTTP methods impose particular properties on requests, done with them.Idempotent requests can be retried any number of times and the result should always be as if the request have been handled once and only once.Safe requests should have no side effects that the client can be held accountable for.
  15. Now we nicely defined a user resource and we care about HTTP methods.We GET the user, change his settings and PUT the whole user back.The intent was only to change the user settings, why do I have to PUT the whole user?Some try to solve this problem by standardizing a new HTTPPATCH method, although Web has been living without it all the time.
  16. Resources != Objects, HTTP Methods!=Business Operations.If you find yourself missing domain-specific HTTP methods, think about your resources again.A URI identifies only one resource, but a resource can have more than one URI.
  17. Sometimes people find themselves limited to do CRUD (Create Read Update Delete) APIs because of the limited set of HTTP methods.
  18. Best example of CRUD is Excel: domain logic is in the user’s head!We want domain logic to be on the server. User should just navigate his way through the workflow.
  19. A better approach would be to model user settings as a resource on its own.
  20. Sometimes APIs are documented using URL templates.This hinders loose coupling.Only URI templates shared out of band are bad. User can safely discover a template by GETting a resource (like Open Search does).
  21. Now we have resources,their URIs and we appreciate HTTP methods.Still we have a long way to go to be RESTful according to the Richardson REST Maturity Model.
  22. When putting the API’s version number into the URL, we couple our clients to that particular version.There is no way we can build a future-proof client for that service.
  23. A much better way of dealing with versions is an HTTP Accept Header.It can incorporate a version number for our specific media type.
  24. The same is with languages.The only valid reason for that is if different languages discriminate unique resources.
  25. HTTP supports Accept-Language Header for that.
  26. If we stick with HTTP features instead of inventing the wheel on top of it, we arrive at the next level of the RRMM.
  27. What is wrong with this?
  28. Generic media types.Clients are tightly coupled to our API’s documentation in order to figure out how to handle the data.Otherwise it’s just an arbitrary JSON BLOB.
  29. Messages should be self-descriptive.
  30. Given we know that the media type describes a product.But we have no idea, what we can further do with it.We are again bound to the documentation.
  31. A better way is to supply next options for that resource in its representation.This is exactly what the web applications do with anchors all the time.We can also use something like an Xform and specify the HTTP method along with required data.
  32. After enabling hypermedia controls in our resources representations we finally achieve the top level of the RRMM.Now our RESTful application looks almost the same as any conventional website: navigate between resources, transitioning the business workflow from state to state. Much like an online shopping process.And there is nothing wrong with it. Websites are in fact RESTful applications.So why do we treat our APIs differently, designing them separately from the UI, putting them on a separate URL?Just provide computer-friendly representations to the resources you human users are already working with through the UI.
  33. Recap of the presentation.
  34. Recap of recap of the presentation.
  35. People seem to learn better when they see the big picture, so here is one…