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
850
Consensus: An Introduction to Raft
vanstee
21
3.3k
Convergent Replicated Data Types
vanstee
4
890
Pour Over Brewing Method
vanstee
1
430
Celluloid & DCell
vanstee
4
620
Map Reduce & Ruby
vanstee
10
920
Other Decks in Programming
See All in Programming
VibeCodingからAgenticWorkflowへ
starfish719
0
770
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
410
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.9k
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
540
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
3
1.6k
MySQLとPostgreSQLって何が違うの?
akagami
0
130
ソフトウェアラスタライザ
fadis
1
480
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
120
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
7.6k
Android CLI
fornewid
0
230
バグを直したら useEffect が消えた
colorful12
3
690
typoなんかねぇよ
raspython3
0
410
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
250
Code Reviewing Like a Champion
maltzj
528
40k
Code Review Best Practice
trishagee
74
20k
The Language of Interfaces
destraynor
162
27k
Technical Leadership for Architectural Decision Making
baasie
3
520
30 Presentation Tips
portentint
PRO
1
370
GraphQLとの向き合い方2022年版
quramy
50
15k
The Pragmatic Product Professional
lauravandoore
37
7.4k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
440
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