$30 off During Our Annual Pro Sale. View Details »
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
660
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.2k
Elixir and Ecto
vanstee
5
970
Bootstrap
vanstee
8
810
Consensus: An Introduction to Raft
vanstee
21
3k
Convergent Replicated Data Types
vanstee
4
810
Pour Over Brewing Method
vanstee
1
370
Celluloid & DCell
vanstee
4
570
Map Reduce & Ruby
vanstee
10
840
Other Decks in Programming
See All in Programming
AIコーディングエージェント(Gemini)
kondai24
0
220
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
830
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
6
1.3k
俺流レスポンシブコーディング 2025
tak_dcxi
14
8.8k
WebRTC と Rust と8K 60fps
tnoho
2
2k
sbt 2
xuwei_k
0
300
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
720
エディターってAIで操作できるんだぜ
kis9a
0
730
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
140
生成AIを利用するだけでなく、投資できる組織へ
pospome
2
340
connect-python: convenient protobuf RPC for Python
anuraaga
0
410
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.7k
4 Signs Your Business is Dying
shpigford
186
22k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Code Reviewing Like a Champion
maltzj
527
40k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Practical Orchestrator
shlominoach
190
11k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
A Tale of Four Properties
chriscoyier
162
23k
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