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
HTTP API Design for iOS Applications
Search
Patrick Van Stee
August 16, 2013
Programming
11
670
HTTP API Design for iOS Applications
Patrick Van Stee
August 16, 2013
Tweet
Share
More Decks by Patrick Van Stee
See All by Patrick Van Stee
Raft: Consensus for Rubyists
vanstee
141
7.3k
Elixir and Ecto
vanstee
5
980
Bootstrap
vanstee
8
810
Consensus: An Introduction to Raft
vanstee
21
3.1k
Convergent Replicated Data Types
vanstee
4
830
Pour Over Brewing Method
vanstee
1
380
Celluloid & DCell
vanstee
4
580
Map Reduce & Ruby
vanstee
10
870
Other Decks in Programming
See All in Programming
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
560
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.4k
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
20
7.1k
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
Fragmented Architectures
denyspoltorak
0
150
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
Featured
See All Featured
Google's AI Overviews - The New Search
badams
0
900
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
The Cult of Friendly URLs
andyhume
79
6.8k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
How STYLIGHT went responsive
nonsquared
100
6k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
63
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
430
KATA
mclloyd
PRO
34
15k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
92
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
So, you think you're a good person
axbom
PRO
2
1.9k
Transcript
HTTP API Design for iOS Applications
@vanstee Big Nerd Ranch
• Modeling Resources • Tools: Server and Client • Real
world problems • Future
Modeling Resources
The key abstraction of information in REST is a resource.
re·source /ˈrēˌsôrs/ A resource is a conceptual mapping to a
set of entities, not the entity that corresponds to the mapping at any particular point in time.
Resources are not just database records
Resources are the nouns. HTTP methods are the verbs. URIs
are the identifiers. Media types are the representations.
But what about transactions? searches? complex actions?
Don’t do this: POST /accounts/1/transfer/500.00/to/2 Try this instead: POST /transactions
{ “from”: 1, “to”: 2, “amount”: 500.00 }
Tools
Server-side • Rails • Active Model Serializers • Custom Responders
• rack-test and json_spec
Client-side • AFNetworking • RestKit (if you really need it)
• VCRURLConnection and mitmproxy
Real World Problems
Versioning Don’t do this: POST /v1/users/1 Try this instead: POST
/users/1 Accept: application/json; version=1.0
Authentication • OAuth2 with API routes for token generation •
NSURLConnection supports cookies • Basic Authentication over HTTPS*
Caching • NSURLCache has support for Cache-Control and ETags •
AFNetworking supports this by default • Rails gives you these for free
Smarter Requests • Side loading associated resources • HTTP Pipelining
for GET, HEAD, PUT, and DELETE requests • HTTP compression
Future
HTTP 2.0 • Based on SPDY • Multiplexing • Server
Push • Better compression
JSON API • Standard hypermedia type • Always namespaced •
Always returns collections for easy parsing • Support for batch operations
JSON Patch • Standard hypermedia type for updating records •
Easily handle associations • Send minimal amount of information
Thanks blog.steveklabnik.com designinghypermediaapis.com afnetworking.com jsonapi.org