Top Banner
31
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: REST overview
Page 2: REST overview

Web Services

(Legacy) System

Web Service API : 80

Page 3: REST overview

Web Services

(Legacy) System

Web Service API : 80

Page 4: REST overview

The Types of Web Services

Big Web Services

WS-Notification

WS-Security

WSDL

SOAP

REST

REST

RPC style

REST-RPC hybrid

Page 5: REST overview

RESTful Web Services

Page 7: REST overview

Bookings

Routes

Passengers

HTTPApplication

Page 8: REST overview

Bookings

Routes

Passengers

Resources

HTTPApplication

Page 9: REST overview

/booking/{id}/

/route/{id}/

/passenger/{id}/

POSTGETPUT

DELETE

Application

Resources

Page 10: REST overview

/booking/{id}/

/route/{id}/

/passenger/{id}/

POSTGETPUT

DELETE

Application

ResourcesAddressable

Page 11: REST overview

/booking/{id}/

/route/{id}/

/passenger/{id}/

POSTGETPUT

DELETE

Application

ResourcesAddressableUniform

Interface

Page 12: REST overview

/booking/{id}/

/route/{id}/

/passenger/{id}/

Application

GET /booking/123/

Addressable Resources

Page 13: REST overview

/booking/{id}/

/route/{id}/

/passenger/{id}/

Application

GET /booking/123/

State and Representation

Addressable Resources

Page 14: REST overview

/booking/{id}/

/route/{id}/

/passenger/{id}/

Application

GET /booking/123/

State and Representation

Addressable Resources

id: 123, pickupTime: ‘2010-12-13T09:00:00’, passenger: { link: { href: ‘/passenger/234’, rel: ‘related’ } }

200 OK

Page 15: REST overview

REST = HTTP Used Right

REST was “developed” in parallel with the HTTP/1.1 protocol

Caching and conditional GET

Proxies

HTTP headers (e.g.content negotiation)

HTTP methods

Page 16: REST overview

Everything Is a Resource

There shall be nothing else

Page 17: REST overview

Everything Is a Resource

There shall be nothing else

ROA

Page 18: REST overview

Everything Is a Resource

There shall be nothing else

•Version 1.0.3 of the software release•The latest version of the software release•Search results for the word ‘Galactica’•The next prime number after 1024•The relationship between Alice and Bob•A list of open bugs in the bug database

Page 19: REST overview

Clean and Descriptive URIs

Page 20: REST overview

Clean and Descriptive URIs

/software/releases/1.0.3.tar.gz/software/releases/latest.tar.gz/search/Galactica/nextprime/1024/relationships/Alice;Bob/bugs/by-state/open

Page 21: REST overview

State(lessness)

Application vs. Resource

Page 22: REST overview

The Uniform Interface

Page 23: REST overview

The Uniform Interface

GET - safe, idempotentPUT - idempotentDELETE - idempotentPOST - “complex”

Page 24: REST overview

The Uniform Interface

200 - OK201 - Created301 - Moved Permanently400 - Bad Request404 - Not Found409 - Conflict500 - Internal Server Error

Page 25: REST overview

Connectedness

route

booking

passenger

Page 26: REST overview

Hypermedia as the Engine of Application State

route

booking

passenger

Page 27: REST overview

Problems?

Transactions

Asynchronous tasks

Batch jobs

Relationships between resources

Partial updates

Partial representations

Page 28: REST overview

REST WS*

Ignores HTTPGood tool supportWSDL“Standards”Plethora of Security Standards

Embraces HTTPNo bandwidth overheadSimplicityWeb already is RESTfulHTTPS / HTTP Diges, OAuth

Page 29: REST overview

Why?

Page 30: REST overview
Page 31: REST overview