Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building well-defined APIs part 1: Proper HTTP
Search
Nikica Jokić
December 23, 2014
Technology
0
90
Building well-defined APIs part 1: Proper HTTP
Short intro to Ruby port of Webmachine.
Nikica Jokić
December 23, 2014
Tweet
Share
More Decks by Nikica Jokić
See All by Nikica Jokić
Aggregating data accountably and consistently
neektza
0
55
Other Decks in Technology
See All in Technology
"なるべくスケジューリングしない" を実現する "PreferNoSchedule" taint
superbrothers
0
120
MySQL AIとMySQL Studioを使ってみよう
ikomachi226
0
110
ブラウザ拡張のセキュリティの話 / Browser Extension Security
flatt_security
0
220
2025 DORA Reportから読み解く!AIが映し出す、成果を出し続ける組織の共通点 #開発生産性_findy
takabow
2
820
Digitization部 紹介資料
sansan33
PRO
1
6k
事業状況で変化する最適解。進化し続ける開発組織とアーキテクチャ
caddi_eng
1
9.2k
経営から紐解くデータマネジメント
pacocat
9
1.7k
IaC を使いたくないけどポリシー管理をどうにかしたい
kazzpapa3
1
180
レガシーシステム刷新における TypeSpec スキーマ駆動開発のすゝめ
tsukuha
4
880
命名から始めるSpec Driven
kuruwic
3
710
DDD x Microservice Architecture : Findy Architecture Conf 2025
syobochim
13
6.9k
Digital omtanke på Internetdagarna 2025
axbom
PRO
0
150
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
4 Signs Your Business is Dying
shpigford
186
22k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.2k
The Language of Interfaces
destraynor
162
25k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Music & Morning Musume
bryan
46
7k
Scaling GitHub
holman
464
140k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.1k
Code Review Best Practice
trishagee
73
19k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
GraphQLとの向き合い方2022年版
quramy
49
14k
Transcript
Proper HTTP Building well-defined APIs, part 1: @neektza Nikica Jokić
HTTP is deceptively simple
• simple syntax, semantics up to you HTTP is deceptively
simple
• simple syntax, semantics up to you • easy to
build crappy, bad-behaving APIs HTTP is deceptively simple
• simple syntax, semantics up to you • easy to
build crappy, bad-behaving APIs • use error status codes HTTP is deceptively simple
• simple syntax, semantics up to you • easy to
build crappy, bad-behaving APIs • use error status codes • respect content-types (accept headers) HTTP is deceptively simple
• simple syntax, semantics up to you • easy to
build crappy, bad-behaving APIs • use error status codes • respect content-types (accept headers) • handle resource migration and locations HTTP is deceptively simple
A huge SVG! http://for-get.github.io/http-decision-diagram/httpdd.fsm.html
Webmachine (1/2)
• Not a framework - a toolkit Webmachine (1/2)
• Not a framework - a toolkit • Implements the
HTTP protocol as a state-machine Webmachine (1/2)
• Not a framework - a toolkit • Implements the
HTTP protocol as a state-machine Webmachine (1/2)
• Not a framework - a toolkit • Implements the
HTTP protocol as a state-machine Webmachine (1/2)
• Not a framework - a toolkit • Implements the
HTTP protocol as a state-machine • Several implementations: Webmachine (1/2)
• Not a framework - a toolkit • Implements the
HTTP protocol as a state-machine • Several implementations: • Webmachine (1st Erlang, then Ruby) Webmachine (1/2)
• Not a framework - a toolkit • Implements the
HTTP protocol as a state-machine • Several implementations: • Webmachine (1st Erlang, then Ruby) • Liberator (Clojure) Webmachine (1/2)
• Not a framework - a toolkit • Implements the
HTTP protocol as a state-machine • Several implementations: • Webmachine (1st Erlang, then Ruby) • Liberator (Clojure) • others? Webmachine (1/2)
A huge SVG! Again! http://for-get.github.io/http-decision-diagram/httpdd.fsm.html
Webmachine (2/2)
• Declarative Webmachine (2/2)
• Declarative Webmachine (2/2) get '/hello/:name' do "Hello #{params[:name]}!" end
• Declarative • Works by describing facts about the resource
Webmachine (2/2) get '/hello/:name' do "Hello #{params[:name]}!" end
• Declarative • Works by describing facts about the resource
Webmachine (2/2) get '/hello/:name' do "Hello #{params[:name]}!" end def resource_exists? resource end
• Declarative • Works by describing facts about the resource
Webmachine (2/2) get '/hello/:name' do "Hello #{params[:name]}!" end def resource_exists? resource end • known-method? / method-allowed ? • known-media-type? / media-type-available? • allowed? / authorised? • exists? / existed? • moved-temporarily? / moved-permanently?