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
Building well-defined APIs part 1: Proper HTTP
Search
Nikica Jokić
December 23, 2014
Technology
0
91
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
56
Other Decks in Technology
See All in Technology
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.5k
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
240
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.6k
仕様書駆動AI開発の実践: Issue→Skill→PRテンプレで 再現性を作る
knishioka
2
680
Context Engineeringの取り組み
nutslove
0
370
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
1
450
Cosmos World Foundation Model Platform for Physical AI
takmin
0
940
30万人の同時アクセスに耐えたい!新サービスの盤石なリリースを支える負荷試験 / SRE Kaigi 2026
genda
4
1.3k
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
600
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
SRE Enabling戦記 - 急成長する組織にSREを浸透させる戦いの歴史
markie1009
0
130
プロポーザルに込める段取り八分
shoheimitani
1
500
Featured
See All Featured
First, design no harm
axbom
PRO
2
1.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
120
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
100
Speed Design
sergeychernyshev
33
1.5k
Mind Mapping
helmedeiros
PRO
0
89
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
230
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
50k
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?