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
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
980
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
870
Other Decks in Programming
See All in Programming
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
900
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
190
Basic Architectures
denyspoltorak
0
660
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
400
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
CSC307 Lecture 08
javiergs
PRO
0
670
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
CSC307 Lecture 06
javiergs
PRO
0
680
AgentCoreとHuman in the Loop
har1101
5
220
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
6
1.9k
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
0
220
Docker and Python
trallard
47
3.7k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
72
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Deep Space Network (abreviated)
tonyrice
0
45
The Language of Interfaces
destraynor
162
26k
Between Models and Reality
mayunak
1
180
Testing 201, or: Great Expectations
jmmastey
46
8k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
The Pragmatic Product Professional
lauravandoore
37
7.1k
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