Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
140
7.2k
Elixir and Ecto
vanstee
5
960
Bootstrap
vanstee
8
800
Consensus: An Introduction to Raft
vanstee
21
3k
Convergent Replicated Data Types
vanstee
4
800
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
WebRTC と Rust と8K 60fps
tnoho
2
1k
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
540
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
1
180
仕様がそのままテストになる!Javaで始める振る舞い駆動開発
ohmori_yusuke
8
4.7k
All(?) About Point Sets
hole
0
230
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
2
1.2k
最新のDirectX12で使えるレイトレ周りの機能追加について
projectasura
0
310
JEP 496 と JEP 497 から学ぶ耐量子計算機暗号入門 / Learning Post-Quantum Crypto Basics from JEP 496 & 497
mackey0225
2
510
[SF Ruby Conf 2025] Rails X
palkan
0
380
CSC305 Lecture 15
javiergs
PRO
0
210
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
110
イベントストーミングのはじめかた / Getting Started with Event Storming
nrslib
1
770
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
246
12k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Side Projects
sachag
455
43k
Designing for humans not robots
tammielis
254
26k
Building Adaptive Systems
keathley
44
2.8k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Faster Mobile Websites
deanohume
310
31k
How GitHub (no longer) Works
holman
316
140k
It's Worth the Effort
3n
187
29k
A better future with KSS
kneath
239
18k
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