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
hfcorriez
December 24, 2014
Design
1
140
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
32
Other Decks in Design
See All in Design
顕在化されていない期待、デザインの灯台
daitorii
1
1k
Amebaデザインシステム Spindleの開発 / The Development of Spindle
spindle
4
510
共創のための地域基盤としての非公式組織の形成 / Informal community as an infrastructure for co-creation
fumiyaakasaka
0
170
Sociotechnical design for software and human systems
xinyao
1
410
1人歩きする営業資料作成
yutoshukuya
0
110
ゲームクリエイター、事業会社のデザイナーになる
satomium1
0
160
非デザイナーのフロントエンドエンジニアがOOUIを考える
yud0uhu
8
2.2k
ウェブディレクターを救うBacklog
wattlaa
0
250
プロダクトデザイン部 組織紹介(デザイナー向け)
chatwork_hr
1
140
Design Leadership in Challenging Times
morganepeng
3
280
間違った「問い」を乗り越え ノベルティをプチバズりさせた話
takaikanako
0
1.1k
BtoB SaaS Design Conference 登壇資料 Cloudbase LT
narizuka
0
470
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
236
11k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
14
1.3k
Building Your Own Lightsaber
phodgson
97
5.6k
Designing on Purpose - Digital PM Summit 2013
jponch
109
6.4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
319
20k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.3k
Become a Pro
speakerdeck
PRO
8
4.4k
Designing for Performance
lara
601
67k
The Language of Interfaces
destraynor
150
22k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
272
12k
Documentation Writing (for coders)
carmenintech
59
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!