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
610
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
137
6.9k
Elixir and Ecto
vanstee
5
910
Bootstrap
vanstee
8
770
Consensus: An Introduction to Raft
vanstee
22
2.9k
Convergent Replicated Data Types
vanstee
4
740
Pour Over Brewing Method
vanstee
1
340
Celluloid & DCell
vanstee
4
540
Map Reduce & Ruby
vanstee
10
780
Other Decks in Programming
See All in Programming
M5UnitUnified 最新動向 2025/05
gob
0
140
Bedrock × Confluenceで簡単(?)社内RAG
iharuoru
1
130
医療系ソフトウェアのAI駆動開発
koukimiura
1
110
設計の本質:コード、システム、そして組織へ / The Essence of Design: To Code, Systems, and Organizations
nrslib
10
3.8k
파급효과: From AI to Android Development
l2hyunwoo
0
160
バイラテラルアップサンプリング
fadis
3
520
AWS Summit Hong Kong 2025: Reinventing Programming - How AI Transforms Our Enterprise Coding Approach
dwchiang
0
140
By the way Google Cloud Next 2025に行ってみてどうだった
ymd65536
0
130
ぽちぽち選択するだけでOSSを読めるVSCode拡張機能
ymbigo
14
6.3k
KANNA Android の技術的課題と取り組み
watabee
1
500
CursorとDevinが仲間!?AI駆動で新規プロダクト開発に挑んだ3ヶ月を振り返る / A Story of New Product Development with Cursor and Devin
rkaga
3
770
Golangci-lint v2爆誕: 君たちはどうすべきか
logica0419
1
260
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
329
39k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
Statistics for Hackers
jakevdp
799
220k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Site-Speed That Sticks
csswizardry
6
540
Practical Orchestrator
shlominoach
187
11k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Docker and Python
trallard
44
3.4k
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