You are on page 1of 12

Linked Data and REST-based infrastructures:

REST Introduction
Adolfo Ruiz Calleja
23/09/2017
Index
• Let’s remember HTTP
• REST Concept
• REST Constrains
• REST data elements
• Demo
• Get and Post tunneling

2
Let’s remember HTTP

3
4
5
REST Concept
• REST = REpresentational State Transfer
(between resources)

• A style of software architecture

• Two key ideas:


– Resource-oriented
– Set of methods whose semantics are known a priori
REST Constrains
• Client-Server
• Uniform Interface
– Very simple!!
• Stateless
– Session state on the client
– Visibility, reliability, scalability (maintainability?)
• Cacheable
– Efficiency vs. reliability
• Layered system
REST data elements: Methods
• Uniform Interface using HTTP methods
(GET, PUT, POST, DELETE)
– https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
– Simple

HTTP Method CRUD Desc.


POST CREATE Create -
GET RETRIEVE Retrieve Safe,Idempotent,Cacheable

PUT UPDATE Update Idempotent

DELETE DELETE Delete Idempotent


REST data elements: Resources
• Each resource has a URI
• Resources should NOT include a verb

• Collections and resources can be distinguished


• http://www.example.com/members
• http://www.example.com/members/adolfo

• The API should describe the data related to each


resource

• Example: Google Drive


https://developers.google.com/drive/v2/reference/
Example: Diigo

https://www.diigo.com/api_dev
Get and Post tunneling
• Use always Get (or Post) as method and include a
verb (an action) on the resource name

• This is A BAD PRACTICE


• But it is done

• These APIs are technically NOT REST


•But they are considered as such

• Examples: Wordpress
https://developer.wordpress.com/docs/api/
https://developers.google.com/drive/v2/reference/
Software maintenance:
REST Introduction

Adolfo Ruiz Calleja


23/09/2017

You might also like