$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RESTful Web Services
Search
Allisson Azevedo
November 02, 2011
Technology
4
220
RESTful Web Services
Uma visão geral sobre RESTful Web Services
Allisson Azevedo
November 02, 2011
Tweet
Share
More Decks by Allisson Azevedo
See All by Allisson Azevedo
Programação Assíncrona com Asyncio
allisson
0
110
Crawleando sites com NodeJS
allisson
0
160
Introdução a linguagem Go
allisson
0
310
Docker + Django
allisson
5
650
Construindo um micro framework web em Python
allisson
0
230
Consumindo API's OAuth{1,2} com Python
allisson
1
190
Tarefas assíncronas com django e celery
allisson
1
24k
Deploy completo de uma aplicação Django
allisson
6
510
Desenvolvimento Web com Django
allisson
0
140
Other Decks in Technology
See All in Technology
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
0
640
Data Hubグループ 紹介資料
sansan33
PRO
0
2.3k
モバイルゲーム開発におけるエージェント技術活用への試行錯誤 ~開発効率化へのアプローチの紹介と未来に向けた展望~
qualiarts
0
260
useEffectってなんで非推奨みたいなこと言われてるの?
maguroalternative
9
6.2k
Product Engineer
resilire
0
130
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
0
120
インフラ室事例集
mixi_engineers
PRO
2
220
私のRails開発環境
yahonda
0
180
HIG学習用スライド
yuukiw00w
0
110
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
9.9k
Active Directory 勉強会 第 6 回目 Active Directory セキュリティについて学ぶ回
eurekaberry
16
5.9k
Bakuraku Engineering Team Deck
layerx
PRO
11
5.4k
Featured
See All Featured
Six Lessons from altMBA
skipperchong
29
4.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Invisible Side of Design
smashingmag
302
51k
How to Ace a Technical Interview
jacobian
280
24k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
GitHub's CSS Performance
jonrohan
1032
470k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
690
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Transcript
RESTful Web Services Allisson Azevedo II Encontro Comunicação Digital http://allisson.eti.br
Web Services
Web Services ➔ Comunicação entre sistemas ➔ HTTP como meio
de transporte ➔ Protocolo estável ➔ Simples ➔ Escalável ➔ Tráfego permitido
Web Services ➔ Independência ➔ Sistema operacional ➔ Linguagem de
programação ➔ Hardware
Web Services ➔ Padrões Abertos ➔ XML ➔ XML-RPC ➔
SOAP
Web Services - XML ➔ Representação eficiente para sistemas ➔
Fácil manipulação em linguagens de programação ➔ Padrão para troca de informações
Exemplo - RSS
Exemplo - RSS
Web Services - XML-RPC ➔ Criado por Dave Winer (1995)
➔ Transportado via protocolo HTTP ➔ Focado na simplicidade
XML-RPC request
XML-RPC response
Web Services - SOAP ➔ Padrão para Web Services (W3C)
➔ Transporte em vários protocolos ➔ Descrição dos serviços disponíveis (WSDL) ➔ Em desenvolvimento (1.2 W3C)
SOAP request
SOAP response
Web Services - SOAP ➔ Crítica ➔ Complexidade dos formatos
SOAP e WSDL
REST
REpresentational State Transfer
REST não é ➔ Novo envelope xml semelhante ao SOAP
➔ Toolkit/Framework ➔ Padrão ➔ Sem especificação na W3C
REST é ➔ Princípios para desenvolvimento de uma arquitetura ➔
Utiliza padrões já existentes ➔ Tese de Roy Fielding (2000)
REST ➔ Stateless ➔ Orientado a Recurso (Resource- Oriented) ➔
Interface uniforme para acesso aos recursos ➔ Representações independentes (baseadas no Content-Type)
REST - Stateless ➔ Toda requisição HTTP é completamente isolada
de outras ➔ Uma requisição precisa incluir todas as informações necessárias para uma resposta do servidor
REST - Recursos ➔ Tudo que é importante ao ponto
de ser exposto pelo sistema na web
REST - Recursos ➔ Possíveis recursos: ➔ Bookmarks no Delicious
➔ Atualizações no Twitter ➔ Scraps do Orkut ➔ Fotos no Flickr
REST - Recursos ➔ URI (Identificador Universal de Recursos) ➔
Todo recurso possui no mínimo uma URI
http://rails.lighthouseapp.com/projects/8994- ruby-on-rails
http://rails.lighthouseapp.com/projects/8994- ruby-on-rails/tickets
http://rails.lighthouseapp.com/projects/8994- ruby-on-rails/milestones
REST – Interface Uniforme ➔ Utiliza os métodos do protocolo
HTTP para manipulação de recursos (Verbos) ➔ GET ➔ POST ➔ PUT ➔ DELETE
REST – Interface Uniforme ➔ GET ➔ Utilizado para obter
uma representação do recurso
REST – Interface Uniforme ➔ POST ➔ Utilizado para criar
um novo recurso
REST – Interface Uniforme ➔ PUT ➔ Utilizado para modificar
um recurso existente
REST – Interface Uniforme ➔ DELETE ➔ Utilizado para apagar
um recurso existente
REST – Interface Uniforme ➔ Associar os verbos ao C.R.U.D
em banco de dados ➔ Create (INSERT) = POST ➔ Read (SELECT) = GET ➔ Update (UPDATE) = PUT ➔ Delete (DELETE) = DELETE
HREF POST /bookmarks/create GET /bookmarks/show/1 POST /bookmarks/update/1 POST/GET /bookmarks/delete/1 URI
POST /bookmarks GET /bookmarks/1 PUT /bookmarks/1 DELETE /bookmarks/1 Não RESTful Verbo Ação Criar (Create) Visualizar (Read) Atualizar (Update) Apagar (Delete) RESTful Verbo Ação Criar (Create) Visualizar (Read) Atualizar (Update) Apagar (Delete)
REST – Representações ➔ Não se limita ao XML ➔
A representação é livre ➔ HTML/XHTML ➔ XML ➔ JSON ➔ PDF ➔ PNG
None
None
None
REST - Classificação ➔ RESTful (High REST) ➔ Implementação em
confirmidade com a tese de Roy Fielding ➔ Utilização dos quatro verbos (POST, GET, PUT, DELETE)
REST - Classificação ➔ REST-RPC (Low REST) ➔ Utilização do
método GET para toda API
REST no mundo real
MySpace
MySpace ➔ RESTful ➔ http://developer.myspace.com/com munity/RestfulAPIs/resources.aspx
None
del.icio.us
del.icio.us ➔ REST-RPC ➔ http://del.icio.us/help/api/
None
Flickr
Flickr ➔ REST-RPC ➔ http://www.flickr.com/services/api/
None
Twitter
Twitter ➔ REST-RPC ➔ http://groups.google.com/group/twi tter-development-talk/web/api- documentation
None
Amazon Simple Storage Service
Amazon Simple Storage Service ➔ RESTful ➔ Exclusivo via web
services ➔ http://docs.amazonwebservices.co m/AmazonS3/2006-03-01/gsg/
None
Dúvidas?
Obrigado!