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
720
11
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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.6k
Elixir and Ecto
vanstee
5
1k
Bootstrap
vanstee
8
840
Consensus: An Introduction to Raft
vanstee
21
3.2k
Convergent Replicated Data Types
vanstee
4
880
Pour Over Brewing Method
vanstee
1
420
Celluloid & DCell
vanstee
4
610
Map Reduce & Ruby
vanstee
10
910
Other Decks in Programming
See All in Programming
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
2.7k
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
240
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
200
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
190
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
210
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
140
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
190
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
360
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
0
240
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
520
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
390
Skip the Path - Find Your Career Trail
mkilby
1
170
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
250
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.6k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Paper Plane
katiecoart
PRO
2
52k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
470
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
410
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