RESTful Web Services
Upcoming SlideShare
Loading in...5
×
 

RESTful Web Services

on

  • 1,220 views

An updated version of my RESTful Web Services talk.

An updated version of my RESTful Web Services talk.

Statistics

Views

Total Views
1,220
Views on SlideShare
1,218
Embed Views
2

Actions

Likes
2
Downloads
25
Comments
0

1 Embed 2

https://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

RESTful Web Services RESTful Web Services Presentation Transcript

  • What Are Web Services?
  • “The Machine-Readable Web”
  • Two Styles of Web Service
  • Service-Oriented Architecture SOAP, XML-RPC, etc.
  • Resource-Oriented Architecture REST
  • “The Human-Readable Web”
  • URLs
  • HTTP
  • HTML
  • URLs + HTTP + HTML
  • URI + HTTP + HTML
  • URI + HTTP + Links
  • URI + HTTP + Hypermedia
  • Fundamental Web Technologies
  • REST means using fundamental webtechnologies idiomatically as the basis for designing web services.
  • Why use REST?
  • The Web Was Designed For It
  • The Web Was Designed For It (Sort of.)
  • Appeal to AuthorityAn appeal to authority or argument by authority is a type of argumentin logic consisting on basing the truth value of an assertion on theauthority, knowledge, expertise, or position of the person asserting it. –Wikipedia
  • Roy T. Fielding, Ph.D.• Co-founder, chairman of the Apache Software Foundation• Co-founder of the Apache HTTP Project• On IETF working groups for HTTP, URI, and HTML • Architectural principal on HTTP working group • First name on HTTP spec• Originator of REST
  • Sam Ruby• Board member of the Apache Software Foundation• Co-chair of W3C’s HTML Working Group• Co-creator of the Web Feed Validator• Originator of Atom• Secretary of the IETF’s AtomPub working group• Co-author of “RESTful Web Services”
  • Greg Hines• Currently giving a presentation about REST
  • Fielding developed RESTwhile writing HTTP 1.1…
  • Fielding developed RESTwhile writing HTTP 1.1… What have you done lately?
  • Aspects of a RESTful Web Service
  • Resources
  • ResourcesA resource can be practically anything.• A blog post• A collection of blog posts• An image• A user• Map coordinates• A bank transaction• Search results
  • Representations
  • A Kitten
  • Some TextName: BobBreed: TabbyFur Length: MediumFur Color: Gray, Brown, WhiteAge: 8 monthsPersonality: Outgoing, but loves to cuddle.
  • A Picture
  • A Drawing
  • A HaikuMy cat is named Bob.I named him after Bob. Bob’sbreath smells like cat food.
  • A Blog Post
  • HTML<!DOCTYPE html><html lang="en"> <head> <title>Gregs Blog: My First Blog Post</title> </head> <body> <article> <header> <h1>My First Blog Post</h1> <p>By Greg Hines</p> </header> <p>This is my first blog post. Woo.</p> <footer> <p>Posted on February 2, 2012 at 12:18 PM</p> <ul class="tags"> <li><a href="/tags/awesome">awesome</a></li> </ul> <p><a href="/entries/2012/02/my-first-blog-post">permalink</a></p> </footer> </article> </body></html>
  • JSON{ "uri": "/entries/2012/02/my-first-blog-post", "title": "My First Blog Post", "author": "/users/greg", "created": 1328728680, "content": "This is my first blog post. Woo.", "tags": [ "/tags/awesome" ]}
  • Addressability
  • AddressabilityEvery resource has at least one URI; every URI points to a resource.http://example.com/entries/2012/02/restful-web-serviceshttp://example.com/tags/awesomehttp://example.com/
  • Interface Uniformity
  • Interface UniformityGET POST
  • Interface Uniformity GET POST PUT DELETE
  • Interface Uniformity GET POST PUTDELETE HEAD OPTIONS
  • Interface Uniformity GET POST PUTDELETE HEAD OPTIONS TRACE CONNECT
  • Interface Uniformity GET POST PUTDELETE HEAD OPTIONS
  • Interface Uniformity GET POST PUTDELETE HEAD OPTIONS PATCH
  • Idempotency
  • Being able to perform an operationmultiple times without changing the result after the initial operation.
  • Interface Uniformity GET POST PUTDELETE HEAD OPTIONS
  • Status Codes
  • Connectedness
  • Resources Link to Each Other
  • Connectedness<?xml version="1.0" encoding="UTF-8"?><resource xmlns="http://example.com/ns/resource"> <content>...</content> <nextResource href="http://example.com/resource/3"/> <prevResource href="http://example.com/resource/1"/></resource>
  • Connectedness<?xml version="1.0" encoding="UTF-8"?><resource xmlns="http://example.com/ns/resource"> <content>...</content> <nextResource href="http://example.com/resource/3"/> <prevResource href="http://example.com/resource/1"/></resource><link rel="alternate" type="application/atom+xml" href="http://example.com/resource/2.atom" />
  • HATEOAS
  • Statelessness
  • HTTP Is Stateless
  • Every RequestHappens in Isolation
  • State Machine
  • Resource State Server-Side
  • Application State Client-Side
  • Transferring State
  • Every HTTP request transfersstate between the application and the requested resource.
  • Resource  Application e.g. GET
  • Resource  Application e.g. PUT
  • Representation State Transfer
  • Representation State Transfer I see what you did there…
  • Richardson Maturity Model
  • Plain Old XML Level Zero
  • Resources Level One
  • HTTP Verbs Level Two
  • Hypermedia Level Three
  • Strive for Level Three
  • Be OK with Level Two
  • Be Embarrassed by Level One
  • Die in a Fire for Level Zero