REST. And now for something completely different. Mike amundsen.com

Similar documents
RESTful Services. Distributed Enabling Platform

Develop Mobile Front Ends Using Mobile Application Framework A - 2

ReST 2000 Roy Fielding W3C

REST A brief introduction

Kim Dalsgaard. Co-owner of, and Software Designer at Trifork Athene Co-founder of Aarhus Ruby Brigade

INF5750. RESTful Web Services

Session 8. Reading and Reference. en.wikipedia.org/wiki/list_of_http_headers. en.wikipedia.org/wiki/http_status_codes

Hypertext Transport Protocol

Copyright 2014 Blue Net Corporation. All rights reserved

Service Oriented Architectures (ENCS 691K Chapter 2)

WWW, REST, and Web Services

REST Easy with Infrared360

Roy Fielding s PHD Dissertation. Chapter s 5 & 6 (REST)

Web Services Week 10

RESTful Web services

WAP Push Message Version 16-August-1999

HTTP, REST Web Services

API Design Methodology. Mike Amundsen API Academy /

REST API s in a CA Plex context. API Design and Integration into CA Plex landscape

04 Webservices. Web APIs REST Coulouris. Roy Fielding, Aphrodite, chp.9. Chp 5/6

Session 9. Deployment Descriptor Http. Reading and Reference. en.wikipedia.org/wiki/http. en.wikipedia.org/wiki/list_of_http_headers

REST in a Nutshell: A Mini Guide for Python Developers

The necessity of hypermedia RDF and an approach to achieve it

A Brief Introduction to REST

Services Web Nabil Abdennadher

Lesson 14 SOA with REST (Part I)

Twelve Patterns for Hypermedia Service Architecture

Web API Best Practices

Lesson 15 SOA with REST (Part II)

UNIT I. A protocol is a precise set of rules defining how components communicate, the format of addresses, how data is split into packets

RESTful -Webservices

RESTFUL WEB SERVICES - INTERVIEW QUESTIONS

Designing RESTful Web Applications. Ben Ramsey

World-Wide Web Protocols CS 571 Fall Kenneth L. Calvert All rights reserved

Understanding RESTful APIs and documenting them with Swagger. Presented by: Tanya Perelmuter Date: 06/18/2018

Introduction. WWW history. Application concepts, WWW and HTTP Perspectives on (mobile) communications. Fredrik Alstorp Torbjörn Söderberg

CSSE 460 Computer Networks Group Projects: Implement a Simple HTTP Web Proxy

COMET, HTML5 WEBSOCKETS OVERVIEW OF WEB BASED SERVER PUSH TECHNOLOGIES. Comet HTML5 WebSockets. Peter R. Egli INDIGOO.COM. indigoo.com. 1/18 Rev. 2.

Restful Interfaces to Third-Party Websites with Python

Computer Networks. Wenzhong Li. Nanjing University

Zero Latency HTTP The comet Technique

REST API Developer Preview

Project 2 Implementing a Simple HTTP Web Proxy

Department of Computer Science. Burapha University 6 SIP (I)

Introduction to RESTful Web Services. Presented by Steve Ives

PS/2 Web Services

Project 2 Group Project Implementing a Simple HTTP Web Proxy

Mobile Computing. Logic and data sharing. REST style for web services. Operation verbs. RESTful Services

Module 3 Web Component

REST AND AJAX. Introduction. Module 13

Other architectures are externally built or expanded

There is REST and then there is REST. Radovan Semančík November 2017

REST Web Services Objektumorientált szoftvertervezés Object-oriented software design

Backends and Databases. Dr. Sarah Abraham

Notes beforehand... For more details: See the (online) presentation program.

Application Development

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Backends and Databases. Dr. Sarah Abraham

Lecture 25. Tuesday, November 21 CS 475 Networks - Lecture 25 1

Handy Tools for Designing Great APIs. Mike

What is REST? ; Erik Wilde ; UC Berkeley School of Information

Web-APIs. Examples Consumer Technology Cross-Domain communication Provider Technology

Session 12. RESTful Services. Lecture Objectives

Application Protocols and HTTP

SRIJAN MANANDHAR MQTT BASED COMMUNICATION IN IOT. Master of Science thesis

Web Architecture Part 3

STARCOUNTER. Technical Overview

Introduc)on to Computer Networks

REST. Lecture BigData Analytics. Julian M. Kunkel. University of Hamburg / German Climate Computing Center (DKRZ)

INF 212 ANALYSIS OF PROG. LANGS. INTERACTIVITY. Prof. Crista Lopes

REST Services. Zaenal Akbar

Traditional Web Based Systems

COMMUNICATION PROTOCOLS

Introduction to Information Science and Technology 2017 Networking II. Sören Schwertfeger 师泽仁

RESTful Services for CIM (CIM-RS)

COMPUTER NETWORKS AND COMMUNICATION PROTOCOLS. Web Access: HTTP Mehmet KORKMAZ

OVERVIEW OF ETSI M2M RELEASE 1 STAGE 3 API AND RESOURCE USAGE

SOA & REST. Ola Angelsmark

CS 498RK FALL RESTFUL APIs

Developing RESTful Services Using JAX-RS

Introduction to REST. Kenneth M. Anderson University of Colorado, Boulder CSCI 7818 Lecture 6 08/27/2008. University of Colorado 2008

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Peer-to-Peer Architectures and the Magi Open-Source Infrastructure

Leaving the State: Sessionless (Stateless) Authentication in D8 with Whole Foods Market. BADCamp 2017

Short introduction to REST

TAXII 2.0 Specification Pre Draft

Scalable applications with HTTP

SIP Session Initiation Protocol

Embedded Web Services

Application Level Protocols

REST for SOA. Stefan Tilkov, innoq Deutschland GmbH

RKN 2015 Application Layer Short Summary

A Comparison of Service-oriented, Resource-oriented, and Object-oriented Architecture Styles

Semantic Web Publishing. Dr Nicholas Gibbins 32/4037

Web Science and Web Technology Web Technologies I. Markus Strohmaier

Electronic Mail. Three Components: SMTP SMTP. SMTP mail server. 1. User Agents. 2. Mail Servers. 3. SMTP protocol

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, 2016

Atom: From Blogging to Data, Web (Services) 2.0

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

2/13/2014. A protocol is an agreed-upon convention that defines how communication occurs between two (or more?) endpoints

Transcription:

REST And now for something completely different Mike Amundsen @mamund amundsen.com

Preliminaries Mike Amundsen Developer, Architect, Presenter Hypermedia Junkie I program the Internet Designing Hypermedia APIs with Node and HTML5 O Reilly, Fall 2011

And now for something a completely different

Excuse me... did you say knives'? City Gent #1 (Michael Palin) The Architects Sketch

Consider how often we see software projects begin with adoption of the latest fad in architectural design, and only later discover whether or not the system requirements call for such an architecture Roy T. Fielding, 2000

Consider how often we see software projects begin with adoption of the latest fad in architectural design, and only later discover whether or not the system requirements call for such an architecture Roy T. Fielding, 2000

Consider how often we see software projects begin with adoption of the latest fad in architectural design, and only later discover whether or not the system requirements call for such an architecture Roy T. Fielding, 2000

Representational State Transfer

Representational State Transfer

These are.?

REST is a style

REST is a style of software architecture.

In contrast to

HTTP is a Standard

HTTP is a Standard Transfer Protocol

!=

REST!= HTTP

Well then, what IS REST?

Roy T. Fielding, 2000

REST is a coordinated set of architectural constraints that attempts to minimize latency and network communication while at the same time maximizing the independence and scalability of component implementations. Roy T. Fielding, 2000

REST is a coordinated set of architectural constraints that attempts to minimize latency and network communication while at the same time maximizing the independence and scalability of component implementations. Roy T. Fielding, 2000

REST is a coordinated set of architectural constraints that attempts to minimize latency and network communication while at the same time maximizing the independence and scalability of component implementations. Roy T. Fielding, 2000

REST is a coordinated set of architectural constraints that attempts to minimize latency and network communication while at the same time maximizing the independence and scalability of component implementations. Roy T. Fielding, 2000

REST attempts to minimize latency while maximizing scalability Roy T. Fielding, 2000

Srsly?

But some people say

REST IS Crafting URIs Identifying Resources Designing Responses (JSON, XML, etc.) HTTP Verbs (GET, PUT, POST, DELETE) Headers (Caching, etc.) HTTP Response Codes (200, 404, 418, etc.)

REST IS Crafting URIs Identifying Resources Designing Responses (JSON, XML, etc.) HTTP Verbs (GET, PUT, POST, DELETE) Headers (Caching, etc.) HTTP Response Codes (200, 404, 418, etc.)

Actually

REST IS NOT Crafting URIs Identifying Resources Designing Responses (JSON, XML, etc.) HTTP Verbs (GET, PUT, POST, DELETE) Headers (Caching, etc.) HTTP Response Codes (200, 404, 418, etc.)

REST IS NOT Crafting URIs Identifying Resources Designing Responses (JSON, XML, etc.) HTTP Verbs (GET, PUT, POST, DELETE) Headers (Caching, etc.) HTTP Response Codes (200, 404, 418, etc.)

REST IS NOT Crafting URIs Identifying Resources Designing Responses (JSON, XML, etc.) HTTP Verbs (GET, PUT, POST, DELETE) Headers (Caching, etc.) HTTP Response Codes (200, 404, 418, etc.)

REST IS NOT Crafting URIs Identifying Resources Designing Responses (JSON, XML, etc.) HTTP Verbs (GET, PUT, POST, DELETE) Headers (Caching, etc.) HTTP Response Codes (200, 404, 418, etc.)

But really, what is REST?

A set of constraints.

Another example

Charles Eames

"I have never been forced to accept compromises but I have willingly accepted constraints." Charles Eames, Eames Design, 1989

"I have never been forced to accept compromises but I have willingly accepted constraints." Charles Eames, Eames Design, 1989

"I have never been forced to accept compromises but I have willingly accepted constraints." Charles Eames, Eames Design, 1989

Why constraints?

Is there anything more intimidating?

OK, what are REST s constraints?

There are six REST constraints

Client-Server Not Peer-to-Peer

Stateless No Server-Side Session

Cache Don t hit server every time

Uniform Interface Same API for everyone

Layered System Add hardware any time

Code On Demand * Don t hard-code clients, send code to them.

REST s Constraints 1. Client-Server 2. Stateless 3. Cache 4. Uniform Interface 5. Layered System 6. Code on Demand

Wait, that s it?

Well

"[REST] is achieved by placing constraints on connector semantics where other styles have focused on component semantics." Roy T. Fielding, 2000

"[REST] is achieved by placing constraints on connector semantics where other styles have focused on component semantics." Roy T. Fielding, 2000

"[REST] is achieved by placing constraints on connector semantics where other styles have focused on component semantics." Roy T. Fielding, 2000

Connector!= Component

Component Database File System Message Queue Transaction Manager Source Code

Component == Private

Connector Web Server Browser Agent Proxy Server Shared Cache

Connector == Public

Client Connectors Server The Web Components

And the best way to ensure Connectors work together is

Uniform Interface 1. Identification of Resources 2. Resource Representations 3. Self-Descriptive Messages 4. Hypermedia

Uniform Interface 1. Identification of Resources (URIs) 2. Resource Representations 3. Self-Descriptive Messages 4. Hypermedia

Uniform Interface 1. Identification of Resources (URIs) 2. Resource Representations (Media-Types) 3. Self-Descriptive Messages 4. Hypermedia

Uniform Interface 1. Identification of Resources (URIs) 2. Resource Representations (Media-Types) 3. Self-Descriptive Messages (Header+Body) 4. Hypermedia

Uniform Interface 1. Identification of Resources (URIs) 2. Resource Representations (Media-Types) 3. Self-Descriptive Messages (Header+Body) 4. Hypermedia (Links & Forms)

URIs A Uniform Resource Identifier (URI) is a compact string of characters for identifying an abstract or physical resource. RFC2396 URI Generic Syntax

URIs A Uniform Resource Identifier (URI) is a compact string of characters for identifying an abstract or physical resource. RFC2396 URI Generic Syntax

MIME Media Types Specify the nature of the data in the body of a MIME entity and auxiliary information that may be required for certain media types. RFC2046 MIME Media Types

MIME Media Types Specify the nature of the data in the body of a MIME entity and auxiliary information that may be required for certain media types. RFC2046 MIME Media Types

Header + Body Message[s] consist of a start-line, zero or more header fields (also known as "headers"), an empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields, and possibly a messagebody. RFC2616 Hypertext Transfer Protocol HTTP/1.1

Header + Body Message[s] consist of a start-line, zero or more header fields (also known as "headers"), an empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields, and possibly a messagebody. RFC2616 Hypertext Transfer Protocol HTTP/1.1

Links & Forms Hypermedia is defined by the presence of application control information embedded within, or as a layer above, the presentation of information. Roy. T. Fielding, 2000

Links & Forms Hypermedia is defined by the presence of application control information embedded within, or as a layer above, the presentation of information. Roy. T. Fielding, 2000

Seems kinda complicated

REST in one slide Read the dissertation, really!

Component Connector Connector Component Client Connectors Server The Web Components

Those of us who have been trained as architects have this desire perhaps at the very center of our lives: that one day, somewhere, somehow, we shall build one building which is wonderful, beautiful, breathtaking, a place where people can walk and dream for centuries. Christopher Alexander, The Timeless Way of Building - 1979

Those of us who have been trained as architects have this desire perhaps at the very center of our lives: that one day, somewhere, somehow, we shall build one building which is wonderful, beautiful, breathtaking, a place where people can walk and dream for centuries. Christopher Alexander, The Timeless Way of Building - 1979

Those of us who have been trained as architects have this desire perhaps at the very center of our lives: that one day, somewhere, somehow, we shall build one building which is wonderful, beautiful, breathtaking, a place where people can walk and dream for centuries. Christopher Alexander, The Timeless Way of Building - 1979

Those of us who have been trained as architects have this desire perhaps at the very center of our lives: that one day, somewhere, somehow, we shall build one building which is wonderful, beautiful, breathtaking, a place where people can walk and dream for centuries. Christopher Alexander, The Timeless Way of Building - 1979

So

Excuse me... did you say knives'? City Gent #1 (Michael Palin) The Architects Sketch

REST Mike Amundsen @mamund amundsen.com