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
Simple Rest API
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
hfcorriez
December 24, 2014
Design
1
150
Simple Rest API
Describe How to make the Simple Rest API
hfcorriez
December 24, 2014
Tweet
Share
More Decks by hfcorriez
See All by hfcorriez
Tools for startup
hfcorriez
1
48
Other Decks in Design
See All in Design
第18回サイゼミ
lw
1
3.5k
mount_company_profile
mount_inc
0
5.9k
ドルちゃん
design_dolphins
0
580
「余白」と「欲望」を味方につける ——AI時代のデザインエンジニアリングと「越境」の作法 #KNOTS2026
koyaman
1
1.6k
Drawing for Animation
lynteo
2
230
Emmy's Artwork
mcksmith
0
210
From the Visible Crossroads: Turning Outputs into Outcomes
takaikanako
2
1.3k
デザイナーがはばたく未来の入り口『hatch』が描く、新しいデザイナー育成のカタチ
goodpatch
3
3.3k
見栄えと使いやすさの先にある 特別感 をデザインする / Designing a Sense of Specialness Beyond Aesthetics and Usability
bitkey
PRO
0
280
「デザイン」の自分ごと化から始める、デザインピープルのふるまい
mewmo
0
190
爆速開発でAIプロダクトが40万インプレッションになった話
tsubura
0
210
体験負債を資産に変える組織的アプローチ
hikarutakase
0
790
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
What's in a price? How to price your products and services
michaelherold
247
13k
Tell your own story through comics
letsgokoyo
1
850
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
220
The untapped power of vector embeddings
frankvandijk
2
1.6k
Raft: Consensus for Rubyists
vanstee
141
7.4k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
290
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.7k
Building Adaptive Systems
keathley
44
3k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
150
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
130
Fireside Chat
paigeccino
42
3.8k
Transcript
简单的 Rest API
None
None
何谓 HTTP (&5QBUIGJMFIUNM)551 6TFS"HFOU4BGBSJ "VUIPSJ[BUJPOBQJYYYYYYY $PPLJFYYYYYYYY [blank line here] )5510,
%BUF'SJ %FD(.5 $POUFOU5ZQFUFYUIUNM $POUFOU-FOHUI IUNM CPEZ I)BQQZ/FX.JMMFOOJVNI NPSFGJMFDPOUFOUT
垃圾设计
好的设计
Simple
None
简单分解 c νಆ 4FDVSJUZ c ਫ਼ࣥ &OEQPJOU c
)551ٚم 7FSCT c ݖੲ 'JMUFST c ҆ )FBEFST c հ༂ԩ &SSPSIBOEMJOH c ْ߭ࢲݔ 3FTQPOTF c ಪᆣč"VUIĎ
安全 c ࣐ਈႨIUUQT c Ⴈ0"VUIa#BTJD"VUI 5PLFO֩ಪᆣ c ष٢֥"1*ླေቓՑ॥ᇅބ*1॥ᇅ
路径 c ࣐ਈႨ৫֥თBQJQVCVJN c ࣐ਈႨջϱЧݼ֥ਫ਼ࣥđбೂWđBQJW c ሧჷႨگඔDBUT c ҂ေႨջ۬ൔֹ֥ᆶDBUTKTPO
https://api.pubu.im/v1/cats ၂۱ປૅ֥ਫ਼ࣥ
方法 Resource POST GET PUT update DELETE /cats Create cat
List cats Bulk update cats Delete all dogs /articles/1234 - Show cat with ID Update if exists Delete with ID /cats/OP - List cats with operation Bulk update with Operation - /cats/1234/OP - Show a cat with Operation Update with Operation -
过滤 c ႨRVFSZTUSJOHটݖੲDBUT UZQFUFYU c ٳ်ބնཬҐႨഈ֥ٚൔDBUT QBHFTJ[F c ႳѓٚൔᆦӻDBUT GSPNTJ[F
c ᆷקሳ؍DBUT GJFMETJE OBNF
头部 c ކ֥Ⴈሑ c ކ֥॥ᇅߏթ c ކ֥ഡᇂᆦӻ۬ൔ c ष٢"1*ླေᆦӻॴთטႨ Status
code Description 200 OK 201 Created 301 Move Temporature 302 Move Permalink 401 Not Authorized 403 Fobidden 404 Not Found
错误处理 c ႨY Y֥ሑ c ࣐ॖି֥૭ඍհ༂ c षؿߌ༯ൻԛհ༂ט൫ྐ༏ c ۷؟ྐ༏ֹᆶᆷཟ
\ DPEF NFTTBHFo$BUJTBMSFBEZEFBEp NPSF*OGPoIUUQTBQJQVCVJNWDBUTEFBE@JOGPp ^
返回结果 c Ⴈӈ֥ࢲܒ߄۬ൔYNMaKTPOaKTPOQ c ыࢲܒ۷ൡކࡥֆ֥ཛଢđళสࢲܒ۷ൡކگᄖ֥ཛଢ c ൈࡗႨᆜྙ֥ݸ૰ඔ c DBNM$BTFބVOEFSTDPSF@DBTF࿊ᄴીପહᇗေ c
҂ေᇗگ૭ඍ*%bDBU*EJE \ JE OBNFo-VDZp BHF DSFBUFE"U ^ \ NFUB\l^ EBUB\ JE OBNFo-VDZp BHF DSFBUFE"U ^ ^
认证 c ࣐ਈ҂Ⴈ4FTTJPOಪᆣ c ༀс҂ေႨૼ໓ૡቓູ֨ ᆣ c ष٢"1*࣐ਈႨ0"VUI
Simple is not easy!