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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Patrick Van Stee
August 16, 2013
Programming
11
680
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.4k
Elixir and Ecto
vanstee
5
990
Bootstrap
vanstee
8
830
Consensus: An Introduction to Raft
vanstee
21
3.1k
Convergent Replicated Data Types
vanstee
4
850
Pour Over Brewing Method
vanstee
1
390
Celluloid & DCell
vanstee
4
590
Map Reduce & Ruby
vanstee
10
880
Other Decks in Programming
See All in Programming
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
240
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
160
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.1k
ファインチューニングせずメインコンペを解く方法
pokutuna
0
170
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
180
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
420
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
320
Ruby and LLM Ecosystem 2nd
koic
1
1.3k
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
170
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
1k
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.1k
Featured
See All Featured
Side Projects
sachag
455
43k
YesSQL, Process and Tooling at Scale
rocio
174
15k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Odyssey Design
rkendrick25
PRO
2
560
Code Review Best Practice
trishagee
74
20k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
130
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
180
Crafting Experiences
bethany
1
94
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
160
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
100
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
150
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