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
Web APIを理解する
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
taminif
July 15, 2017
Programming
0
360
Web APIを理解する
php conference Kansai 2017
本編LT枠
taminif
July 15, 2017
Tweet
Share
More Decks by taminif
See All by taminif
React Native New Architecture 移行実践報告
taminif
1
190
「とりあえずAI」が招く悲劇〜私がAIで生産性を下げるまでの話〜 / The tragedy caused by "AI for now" - The story of how I used AI to reduce my productivity
taminif
1
270
PuppeteerとPlaywrightの15日間の演劇 / relation of Puppeteer and Playwright
taminif
3
2.3k
Redashの開発はじめました / How to get started Redash development
taminif
0
780
私の生活を変えたHeadless Chrome / Headless Chrome who changed my life
taminif
3
520
WebSocketをiOSに持ち込んで辛い思いをした経験がありますか!? / have you painful experience in web socket?
taminif
3
6.1k
LINEで馬券を購入する / Purchase a betting ticket at LINE
taminif
1
1.6k
SkyWayで一年間運用してきたけどWebRTCってつらいんじゃないの
taminif
2
1k
オンライン英会話とSkyWay
taminif
0
530
Other Decks in Programming
See All in Programming
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
540
Package Management Learnings from Homebrew
mikemcquaid
0
190
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
150
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
19
6.3k
Oxlintはいいぞ
yug1224
5
1.3k
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
590
CSC307 Lecture 08
javiergs
PRO
0
660
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
Fragmented Architectures
denyspoltorak
0
140
AI & Enginnering
codelynx
0
110
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
150
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Technical Leadership for Architectural Decision Making
baasie
1
240
Building the Perfect Custom Keyboard
takai
2
680
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
Utilizing Notion as your number one productivity tool
mfonobong
2
210
New Earth Scene 8
popppiees
1
1.5k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
How to train your dragon (web standard)
notwaldorf
97
6.5k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Transcript
Web APIΛཧղ͢Δ php conference Kansai 2017 ຊฤLT 2017/07/15 େౡ ޫو@sbntaminif
ࣗݾհ • ΣϒϦΦגࣜձࣾWEBΤϯδχΞ • ීஈژͰಇ͍͍ͯ·͢ • ඈͼೖΓࢀՃͱ͍͏͜ͱͰ ٸᬎ͜ͷϓϨθϯΛ࡞Γ·ͨ͠ʂ
Web APIͷઆ໌
௨ৗͷHTTP௨৴ ϒϥβ 1)1αʔόʔ ϦΫΤετ )5.-
APIͷHTTP௨৴ ϒϥβ 1)1αʔόʔ ϦΫΤετ Կ͔͠Βͷ
ͬͯΔ͜ͱ ಉ͡Ͱ͢ʂ
ϒϥβ͕ཧղ͢Δඞཁ͕ ͳ͍ͷͰɺʢ࣮࣭ʣͲΜͳ Ͱฦͤ·͢ɻ
Ͳ͏͍͏࣌ʹ༻͢Δͷ͔
APIͷ༻్ • APIલఏͷγεςϜઃܭ࣌ • ΞϓϦͰใΛऔಘ͢Δ࣌ • ୈࡾऀʹใΛఏڙ͢Δ࣌
REST APIͱ͍͏ ߟ͑ํ
REST APIͱ • ιϑτΣΞΞʔΩςΫνϟͷҰͭ Web APIͰଟ͘࠾༻͞Ε͍ͯΔ • URLHTTP ϝιουͳͲWebͷ੍ʹैΘͤΔ͜ ͱͰڞ௨ཧղΛ࣋ͭ
• TwitterGithubͷAPI RESTͷਪʹैͬͯఏڙ͞Ε͍ͯΔ
αϯϓϧʢGitHub APIʣΛͬͯઆ໌ https://api.github.com/repos ->GETͰΞΫηε->ϨϙδτϦҰཡΛऔಘ ->POSTͰΞΫηε->ϨϙδτϦΛՃ “repos”(ϦϙδτϦ)ͱ͍͏ϦιʔεΛ ૢ࡞͢ΔAPIͱͳΔ ΤϯυϙΠϯτ Ϧιʔε
REST APIͷਪ࣮ ʢϝιουʣ • GETऔಘ • POSTՃ • PUTมߋ •
DELETEআ
REST APIͷਪ࣮ ʢϝιουʣ • GETऔಘ -> R(Read) • POSTՃ ->
C(Create) • PUTߋ৽ -> U(Update) • DELETEআ -> D(Delete) ->σʔλʢϦιʔεʣʹରͯ͠ૢ࡞
REST APIͷਪ࣮ʢURLʣ • Ϧιʔε෦తޠͷෳܗ • usersʢձһʣ • tagsʢλάʣ • Ͱ͖Δ͚ͩ͘ɺར༻ऀʹΘ͔Γ໊͍͢
લΛ͚ͭΔ
REST APIͷਪ࣮ ʢHTTP Responseͦͷ1ʣ • 200൪ΞΫηεʹޭͨ͠߹ʹฦ͢ • 200OK 201Created
REST APIͷਪ࣮ ʢHTTP Responseͦͷ2ʣ • 400൪ΫϥΠΞϯτʹ͕͋Δ߹ʹฦ͢ • 401ೝূ͕ඞཁͳURL 404ͦͦଘࡏ͠ͳ͍URL •
500൪αʔόʹ͕͋Δ߹ʹฦ͢
REST APIʹैࣄ͢Δ͜ͱͰ Θ͔Γ͍͢APIΛ ઃܭ͠·͠ΐ͏
ࢀߟɿWeb API The Good Parts https://www.amazon.co.jp/exec/obidos/ASIN/4873116864/
͋Γ͕ͱ͏͍͟͝·ͨ͠