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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Patrick Van Stee
August 16, 2013
Programming
710
11
Share
HTTP API Design for iOS Applications
Patrick Van Stee
August 16, 2013
More Decks by Patrick Van Stee
See All by Patrick Van Stee
Raft: Consensus for Rubyists
vanstee
141
7.5k
Elixir and Ecto
vanstee
5
990
Bootstrap
vanstee
8
830
Consensus: An Introduction to Raft
vanstee
21
3.2k
Convergent Replicated Data Types
vanstee
4
870
Pour Over Brewing Method
vanstee
1
410
Celluloid & DCell
vanstee
4
600
Map Reduce & Ruby
vanstee
10
900
Other Decks in Programming
See All in Programming
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
2.9k
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.2k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
200
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
140
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
5
710
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
140
CSC307 Lecture 17
javiergs
PRO
0
240
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
260
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
370
AIエージェントの隔離技術の徹底比較
kawayu
0
440
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
340
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
1
200
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
940
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
560
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
150
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
310
Leo the Paperboy
mayatellez
7
1.8k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
160
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
370
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
180
A better future with KSS
kneath
240
18k
Chasing Engaging Ingredients in Design
codingconduct
0
200
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
380
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