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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
110
書籍執筆での生成AIの活用
sat
PRO
1
240
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
2
480
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
130
Amazon Bedrock AgentCore 認証・認可入門
hironobuiga
2
460
SREの仕事を自動化する際にやっておきたい5つのポイント
jacopen
6
1.2k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
新規事業における「一部だけどコア」な AI精度改善の優先順位づけ
zerebom
0
440
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
ドキュメントからはじめる未来のソフトウェア
pkshadeck
4
2.1k
AI開発の落とし穴 〜馬には乗ってみよAIには添うてみよ〜
sansantech
PRO
10
5.6k
入社1ヶ月でデータパイプライン講座を作った話
waiwai2111
1
200
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
150
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
170
Into the Great Unknown - MozCon
thekraken
40
2.2k
Code Review Best Practice
trishagee
74
20k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
190
The Limits of Empathy - UXLibs8
cassininazir
1
210
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
210
We Are The Robots
honzajavorek
0
150
How Software Deployment tools have changed in the past 20 years
geshan
0
31k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
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?