title: Web Services REST-Style: Universal Identifiers, Formats & Protocols h1. Web Services REST-Style: Universal Identifiers, Formats & Protocols Agenda * What's REST? * Universal Identifiers, Formats & Protocols * The Holy REST Trinity - Noun, Verbs, Types * REST Design Principles * Architecture Astronaut REST Speak h1. What's REST? Representational State Transfer (REST) - Meaningless Acronym? Wordplay? rest - n. - peace, ease, or refreshment resulting from the insight that the web works No matter what vendors tell you - no need to "Light Up the Web" - relax - built on an *open architecture using universal identifiers, formats & protocols and _evolving_ open standards* - no need to reinvent the wheel and sign-up for single-vendor offerings. h3. Broad Definition * Best Practices for Designing Web Services for a Unified Human and Programable Web h3. Narrow Definition * Alternative to BigCo Web Services (SOAP, WS-STAR) and RPC-Style Web Services (XML-RPC) h3. Resource, Representation, State, Transfer * (Stateless) Resource Representation -> Open Format + Identifier e.g. HTML+URI * Transfer Rules (Protocol) e.g. HTTP h1. Universal Identifiers, Formats & Protocols - The Holy Trinity * Identifiers -> URLs (Uniform Resource Locator), URIs (Uniform Resource Identifier) * Formats -> HTML (HyperText Markup Language), XML (Extensible Markup Language) * Protocols -> HTTP (HyperText Transfer Protocol), AtomPub (Atom Publishing Protocol) h1. The Holy REST Trinity - Noun, Verbs, Types REST-Speak - Internet-Speak - Plain Old English * Verbs -> Protocols -> Communication & Data Exchange Rules * Nouns -> Identifiers -> Names, Addresses * Types -> Formats -> Documents, Feeds, Photos, Videos, Music, etc. * Verbs -> HTTP GET, POST, PUT, DELETE * Nouns -> @flickr.com/photos/tag/vancouver@, @deli.cio.us/vanajax/tag/libraries@, etcetera * Types -> HTML, RSS, PNG, etcetera h1. REST Design Principles - What's REST? * Idenifiers Matter - Choose Great Names * Open Formats Matter - Avoid Vendor Lock-In * Protocols Matter - Learn more about HTTP and Use Best Practices ** Use HTTP GET for Read-Only/Side-Effect-Free Requests ** Use HTTP Accept Headers for Format Selection ** Use Full HTTP Method Vocabulary (GET, POST, PUT, DELETE) * No Web without Linking and No Linking without Identifiers! * (Stateless) Resource Representation -> Open Format + Identifier e.g. HTML+URI h1. Architecture Astronaut REST Speak * REST-y * REST-ful * Resource-Oriented Architecure (ROA) * Web-Oriented Architecure (WOA) * REST-RPC-Hybrid (Three Web Service Architectures - 1) REST, 2) REST-RPC Hybrid, 3) RPC[1] ) fn1. RPC -> Remote Procedure Call