Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Web APIを理解する
Search
taminif
July 15, 2017
Programming
0
350
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
160
「とりあえずAI」が招く悲劇〜私がAIで生産性を下げるまでの話〜 / The tragedy caused by "AI for now" - The story of how I used AI to reduce my productivity
taminif
1
260
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
510
WebSocketをiOSに持ち込んで辛い思いをした経験がありますか!? / have you painful experience in web socket?
taminif
3
6k
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
チームをチームにするEM
hitode909
0
360
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
280
Navigating Dependency Injection with Metro
l2hyunwoo
1
160
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
270
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
110
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
1.4k
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
1
250
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
150
AIエージェントの設計で注意するべきポイント6選
har1101
5
1.8k
Go コードベースの構成と AI コンテキスト定義
andpad
0
130
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.3k
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.7k
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
0
430
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
88
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
83
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.3k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Test your architecture with Archunit
thirion
1
2.1k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
110
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.8k
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/
͋Γ͕ͱ͏͍͟͝·ͨ͠