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
Designing mobile friendly APIs
Search
Milan Cermak
February 13, 2014
Technology
120
0
Share
Designing mobile friendly APIs
Slides from the talk I gave at 1st HTTP API group meetup in Berlin.
Milan Cermak
February 13, 2014
More Decks by Milan Cermak
See All by Milan Cermak
Building a CI/CD pipeline on AWS
milancermak
0
7.1k
HTTP API & Python
milancermak
3
290
Programování pro iOS z pohledu pythonistu
milancermak
0
300
Prečo povedať nie SQL
milancermak
1
140
Other Decks in Technology
See All in Technology
エンジニアは生成AIと どのように向き合うべきか? ことばの意味という観点から
verypluming
3
300
APIテストとは?
nagix
0
160
AIガバナンス実践 - 生成AIコネクタのデータ漏洩リスクと実務対策
knishioka
0
140
Java正規表現エンジン(NFA)の仕組みと パフォーマンスを維持するための最適化手法
takeuchi_132917
0
150
ITエンジニアを取り巻く環境とキャリアパス / A career path for Japanese IT engineers
takatama
4
1.8k
ルールやカスタム機能、どう使う?理想の出力を引き出すために今知りたいIBM Bob 5つの機能
muehara
0
150
個人AIからチームAIへ:開発における品質と生産性の再設計
moongift
PRO
0
320
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
260
JEP 522 Deep Dive - G1 GC同期コスト削減によるスループット向上を徹底検証&解説
tabatad
1
410
Gradle×GitHub_ActionsでCI時間を約50%短縮 ジョブ分割の設計と落とし穴 / Cutting CI Time by ~50% with Gradle and GitHub Actions: Job-Splitting Design and Pitfalls
takatty
0
540
Terraformモジュールは、なぜ「魔境」化するのか
hayama17
1
120
基礎から解説!Icebergで紐解くSnowflake×Databricks連携の現在地
cm_yasuhara
0
400
Featured
See All Featured
Deep Space Network (abreviated)
tonyrice
0
160
Everyday Curiosity
cassininazir
0
210
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Claude Code のすすめ
schroneko
67
220k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
130
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
370
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Site-Speed That Sticks
csswizardry
13
1.2k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
390
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Transcript
Mobile friendly APIs Milan Cermak HTTP API Meetup Group Berlin
Feb 13, 2014
General rules
be religious about documentation
when in doubt RFC 2616
Designing for mobile
Optimize for size and speed
• Bytes matter • Power consumption: • 3G > wifi
> 2G • On cellular, only 2 concurrent networking requests
Content-Encoding: gzip
ETag If-Match If-None-Match
Make the API flexible
Make the API flexible • fields parameter
GET /people/1! {“id”: 1,! “name”: “Milan Cermak”,! “age”: 27,! “hobbies”:
[“programming”, “ice cream”],! ...! }
GET /people/1?fields=name,age! {“name”: “Milan Cermak”,! “age”: 27}
Minimal vs. full approach ! • Send only the minimal
possible representation, let the users specify what they want via fields! • Send the full available representation of the resource
Make the API flexible • zoom parameter
GET /hobbies/programming! {“people”: [“1”, “2”, “3”, “5”, “8”, “11”],! “popularity”:
0.75,! ...! }
GET /hobbies/programming?zoom=people! {“people”: [! {“id”: 1,! “name”: “Milan Cermak”,! “age”:
27! ...! },! ...]! }
Batched requests
Batched requests • i.e. Facebook Graph API • A solution
until widespread adoption of HTTP2 • Not really RESTful, but really useful
POST /api/batch! {[! {“method”: “GET”! “relative_url”: “people/1”! },! {“method”: “GET”,!
“relative_url”: “hobbies/dogs”! }! ]}
Batched requests • Server-side implementation can be tricky: • Error
handling • HTTP headers • Parallel execution vs. POST/PUT/DELETE
Thank you