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
970
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
860
Other Decks in Programming
See All in Programming
Patterns of Patterns
denyspoltorak
0
1.3k
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
170
AIエージェントの設計で注意するべきポイント6選
har1101
7
3.3k
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
610
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.7k
2026年 エンジニアリング自己学習法
yumechi
0
100
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
130
GISエンジニアから見たLINKSデータ
nokonoko1203
0
190
CSC307 Lecture 04
javiergs
PRO
0
650
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
210
[AI Engineering Summit Tokyo 2025] LLMは計画業務のゲームチェンジャーか? 最適化業務における活⽤の可能性と限界
terryu16
2
460
dchart: charts from deck markup
ajstarks
3
970
Featured
See All Featured
Are puppies a ranking factor?
jonoalderson
1
2.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
170
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
420
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
220
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
120
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
From π to Pie charts
rasagy
0
120
Amusing Abliteration
ianozsvald
0
87
Designing Experiences People Love
moore
144
24k
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