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
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.3k
Elixir and Ecto
vanstee
5
970
Bootstrap
vanstee
8
810
Consensus: An Introduction to Raft
vanstee
21
3.1k
Convergent Replicated Data Types
vanstee
4
820
Pour Over Brewing Method
vanstee
1
370
Celluloid & DCell
vanstee
4
580
Map Reduce & Ruby
vanstee
10
850
Other Decks in Programming
See All in Programming
AIエージェントの設計で注意するべきポイント6選
har1101
6
2.8k
Cell-Based Architecture
larchanjo
0
150
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
250
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
610
Implementation Patterns
denyspoltorak
0
140
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
550
Basic Architectures
denyspoltorak
0
150
GoLab2025 Recap
kuro_kurorrr
0
790
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.5k
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
480
ゲームの物理 剛体編
fadis
0
390
CSC307 Lecture 01
javiergs
PRO
0
630
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
170
YesSQL, Process and Tooling at Scale
rocio
174
15k
KATA
mclloyd
PRO
33
15k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
RailsConf 2023
tenderlove
30
1.3k
Practical Orchestrator
shlominoach
190
11k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.8k
Building the Perfect Custom Keyboard
takai
1
670
WCS-LA-2024
lcolladotor
0
400
Deep Space Network (abreviated)
tonyrice
0
32
Java REST API Framework Comparison - PWX 2021
mraible
34
9.1k
Tell your own story through comics
letsgokoyo
0
770
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