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
REST API Design, Part II
Search
Nate Abele
August 30, 2013
Programming
1
220
REST API Design, Part II
Given at PHP Undiscovered, SF.
Nate Abele
August 30, 2013
Tweet
Share
More Decks by Nate Abele
See All by Nate Abele
Running Kubernetes in the Browser. Yes, really. Not really. Kind of.
nateabele
1
62
Un-dux Your Front-End
nateabele
1
140
CloudFormation For Fun & Profit (But Mostly Sanity)
nateabele
0
82
Functional Reactive Systems
nateabele
1
170
ngPittsburgh - AngularUI Router Philosophy
nateabele
1
1.1k
The Future of Programming
nateabele
1
560
Past, Present, and Future: The Evolution of PHP Development
nateabele
1
620
The Future of Programming: PHP Argentina 2014
nateabele
1
130
Designing Hypermedia APIs
nateabele
4
710
Other Decks in Programming
See All in Programming
AI & Enginnering
codelynx
0
140
Package Management Learnings from Homebrew
mikemcquaid
0
270
Metaprogramming isn't real, it can't hurt you
okuramasafumi
0
120
2025年の活動の振り返り
hideg
0
110
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
22
7.9k
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
210
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
1.1k
Oxlint JS plugins
kazupon
1
1.1k
Sekiban + Microsoft Orleans のアクターをAWS対応しました / Sekiban + Microsoft Orleans actors are now supported on AWS.
tomohisa
0
120
Scaling & Coordinating AI Agents for Development - Tamir Dresher
tamirdresher
0
100
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
190
ご飯食べながらエージェントが開発できる。そう、Agentic Engineeringならね。
yokomachi
1
250
Featured
See All Featured
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
Statistics for Hackers
jakevdp
799
230k
Skip the Path - Find Your Career Trail
mkilby
0
66
Designing for Timeless Needs
cassininazir
0
140
A Modern Web Designer's Workflow
chriscoyier
698
190k
Are puppies a ranking factor?
jonoalderson
1
3k
It's Worth the Effort
3n
188
29k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.1k
Raft: Consensus for Rubyists
vanstee
141
7.3k
WENDY [Excerpt]
tessaabrams
9
36k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
Transcript
The Dream of the 90’s is Withering on the Vine
(in Portland)
How to Future-Proof & Increase The Level of Sanity in
the Design of Your APIs, by Respecting the Best Practices of HTTP Or...
This is Roy
Principles • Client-Server • Stateless • Cacheable • Uniform Interface
• Opaque Layering • Code-on-Demand
Objectives •Auth •Querying •Relationships •Pagination •Formats •Caching •Logging •API Versioning
Auth •Simple! •Basic vs. Digest (over SSL, obviously) •Upshot of
Basic: http://user:
[email protected]
/objects •Cookies? •Custom Tokens?
Querying •There are approaches to making this discoverable •They are
ridiculously ivory-tower •Better: ?q=<whatever>
Relationships •Goal: Introspect API domain model and transform object relationships
to URLs
Relationships GET /tasks HTTP/1.1 [{ title: "Finish client demo", completed:
false, _links: { self: { href: "http://my.app/tasks/1138" }, owner: { href: "http://my.app/users/nate" }, subtasks: { href: "http://my.app/tasks/1138/subtasks" } } }]
Pagination GET /tasks?page=5&order=due ?
Pagination HTTP Range! GET /videos/rickroll.mp4 Range: bytes=100-99999
Pagination HEAD /tasks HTTP/1.1 ... HTTP 200 OK Accept-Ranges: tasks
Pagination HEAD /posts HTTP/1.1 ... HTTP 200 OK Accept-Ranges: posts
Pagination GET /posts HTTP/1.1 Range: posts=1-20
Caching (Strategies) • Generated cache keys (ETag, If-None-Match) • For
writes: If-Match • Time-based (Last-Modified / If-Modified-Since)
Logging Custom Response Headers!
Logging X-Query-Log: SELECT * From users WHERE name = "nate"
X-Query-Log: SELECT * From tasks WHERE user_id = 13
Logging X-Query-Log: users.find({ name: "nate" })
DEMO