Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RESTful APIs
Search
Enderson Tadeu S. Maia
December 17, 2014
Programming
5
1.3k
RESTful APIs
A brief introduction to RESTful APIs concept.
Enderson Tadeu S. Maia
December 17, 2014
Tweet
Share
More Decks by Enderson Tadeu S. Maia
See All by Enderson Tadeu S. Maia
Minimalist Operating Systems for Containers
endersonmaia
0
120
De Zero a Docker em 30min
endersonmaia
1
840
Other Decks in Programming
See All in Programming
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
750
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
97
34k
코딩 에이전트 체크리스트: Claude Code ver.
nacyot
0
870
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
240
20250708_JAWS_opscdk
takuyay0ne
2
120
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
980
Git Sync を超える!OSS で実現する CDK Pull 型デプロイ / Deploying CDK with PipeCD in Pull-style
tkikuc
4
240
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
180
すべてのコンテキストを、 ユーザー価値に変える
applism118
4
1.4k
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
590
脱Riverpod?fqueryで考える、TanStack Queryライクなアーキテクチャの可能性
ostk0069
0
340
Goで作る、開発・CI環境
sin392
0
260
Featured
See All Featured
Practical Orchestrator
shlominoach
189
11k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Being A Developer After 40
akosma
90
590k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
The Invisible Side of Design
smashingmag
301
51k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Docker and Python
trallard
45
3.5k
What's in a price? How to price your products and services
michaelherold
246
12k
Producing Creativity
orderedlist
PRO
346
40k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Transcript
RESTful APIs Maceió Dev Meetup December 17, 2014
about.me/endersonmaia
What I’m going to talk
30 minutes to • REST • Constraints • Richard Maturity
Model (RMM) • HTTP Methods • HTTP Satus Codes • Resource Naming • Format • Linking • …
REST Representational State Transfer (Roy Fielding, 2000)
Constraints
Client–server
Stateless
Cacheable
Layered system
Uniform interface
Uniform interface • Resource-Based • Manipulation of Resources Through Representations
• Self-descriptive Messages • Hypermedia as the Engine of Application State (HATEOAS)
RMM Richardson Maturity Model
Level 0 The swamp of POX
Level 0 The swamp of POX $ curl -X POST
-d \ "<?xml version=“1.0"?> \ <methodCall> \ <methodName>examples.getStateName</methodName> \ <params> \ <param> \ <value><i4>40</i4></value> \ </param> \ </params> \ </methodCall>" http://api.example.com
Level 1 Resources
Level 1 Resources • GET - http://host/person?action=add? name=John&age=25 • GET
- http://host/city/delete
Level 2 HTTP Verbs
Level 2 HTTP Verbs • GET - http://host/users • PUT
- http://host/users • DELETE - http://host/users
Level 3 Hypermedia Controls
HTTP Methods
GET
POST
DELETE
PUT
PATCH
OPTIONS
– Leonard Richardson, 2007 "OPTIONS is a promising idea that
nobody uses."
HEAD
HTTP Status Codes
None
2XX
2XX • 200 - OK • 201 - Created •
202 - Accepted • 204 - No Content
3XX
3XX • 301 - Moved Permanently • 304 - Not
Modified
4XX
4XX • 400 - Bad Request • 401 - Unauthorized
• 403 - Forbidden • 404 - Not Found • 409 - Conflict
5XX
5XX • 500 - Internal Server Error • 501 -
Not Implemented
HTTP Headers
HTTP Method x Status
None
None
None
None
More …
Verbs
Verbs • POST - to create (INSERT) a new resource
• GET - to recover (SELECT) a specific resource • PUT/PATCH - to UPDATE a specific resource • DELETE - to DELETE a specific resource
Resource Naming
Resource Naming • POST http://example.com/customers • GET http://example.com/customers/33245 • GET|PUT|DELETE
http://example.com/products/66432 • GET http://example.com/customers/33245/orders • POST http://example.com/customers/33245/orders/ 8769/lineitems • GET http://example.com/customers/33245/orders/ 8769/lineitems/1
Resource Naming Anti-Pattern • GET http://api.example.com/services? op=update_customer&id=12345&format=json • GET http://api.example.com/
update_customer/12345 • GET http://api.example.com/customers/ 12345/update • PUT http://api.example.com/customers/ 12345/update
Response
Format
Format • XML (Atom, …) • JSON (JSON-LD, HAL, …)
None
Linking
None
HATEOAS
Hypermedia As The Engine Of Application State
HATEOAS
HATEOAS
Idempotence & Safe Methods
What’s missing ?
What’s missing ? • More about HTTP Header • HTTP
Authentication samples • Using Tokens • Versioning strategies • ?
References • http://stateless.co/hal_specification.html • http://jsonapi.org • http://www.infoq.com/articles/Web-APIs-From-Start-to-Finish • http://restfulwebapis.com •
http://www.restapitutorial.com • http://martinfowler.com/articles/richardsonMaturityModel.html • http://restcookbook.com • http://www.w3.org/TR/json-ld/ • http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm • http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven • http://brockallen.com/2012/05/14/http-status-codes-for-rest/
Thank you! @endersonmaia