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
概念から学ぶ正しくRESTfulなAPIとWP REST APIでの実例 #wb_rest
Search
potato4d(Takuma HANATANI)
September 03, 2017
Programming
6
3.1k
概念から学ぶ正しくRESTfulなAPIとWP REST APIでの実例 #wb_rest
2017.09.03 #wb_rest HANATANI Takuma #wbosaka #wbkyoto #wbnagano
9月のWordBenchの登壇スライドです。
potato4d(Takuma HANATANI)
September 03, 2017
Tweet
Share
More Decks by potato4d(Takuma HANATANI)
See All by potato4d(Takuma HANATANI)
どうせキレイに書けない処理は逆にAIに書いてもらうほうが良い説 / #kyotojs 22
potato4d
3
310
TSX First な Zero-Runtime SSG potato4d/dodai とその仕組み / owned static site generator #kyotojs
potato4d
1
2k
Vue.js with TSX - From Vue 2.x to Vue 3 #v_tokyo11
potato4d
9
4.7k
終わりゆく Vue 2.x 時代の状態設計のアンサー - Vue 3 の Provider への期待 / The Last Architecture of the Vue 2.x
potato4d
25
6.8k
Web Worker を使ってブラウザ上でポケモンの画像を解析したい! / Pokemon recognition from screenshots in browser using web worker
potato4d
0
1.2k
Firebase & Google Cloud によるサーバーレス帳票管理 #FJUG / Serverless Architecture in Candy
potato4d
8
3.6k
NestJS meetup Tokyo Opening Talk / What is NestJS? #nestjs_meetup
potato4d
11
3.9k
私たちはなぜ SPA で開発するのか / Why you choose SPA
potato4d
39
26k
Amplify Console 誕生以来本番運用しつづけてわかったこと #awswakaran_tokyo
potato4d
6
3.4k
Other Decks in Programming
See All in Programming
みんなでプロポーザルを書いてみた
yuriko1211
0
230
開発効率向上のためのリファクタリングの一歩目の選択肢 ~コード分割~ / JJUG CCC 2024 Fall
ryounasso
0
430
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.7k
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
280
Contemporary Test Cases
maaretp
0
110
Identifying User Idenity
moro
6
9.7k
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
2
480
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
1
250
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
300
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
200
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
140
CSC509 Lecture 09
javiergs
PRO
0
140
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
222
8.9k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
42
2.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
700
Why Our Code Smells
bkeepers
PRO
334
57k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
400
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
505
140k
Facilitating Awesome Meetings
lara
50
6.1k
Statistics for Hackers
jakevdp
796
220k
Transcript
֓೦͔ΒֶͿਖ਼͘͠RESTfulͳ APIͱWP REST APIͰͷ࣮ྫ 2017.09.03 #wb_rest HANATANI Takuma #wbosaka #wbkyoto
#wbnagano
ࠓRESTࡇΓ
͍··Ͱ୯ମͰಈ͘͜ͱΛલఏͱ͍ͯͨ͠ WordPress͕֎෦ʹใ͕ग़ͤ·͢
ͦͯ͠WP REST APIʹΑͬͯͦͷใΛ ΓͱΓ͢Δͱ෯͕͕Γ·͢Αʂ
͔֬ʹWordPressͷσʔλ͕ APIͱͯ͠ఏڙ͞ΕΔͱͰ͖ Δ͜ͱ૿͑Δ
࣮ࡍ͜͏͍͏׆༻ํ๏͕͋Γ·͢ʂ
طʹࣄྫࢁ͋Δ
ͦͷ্͜ͷAPI໊લͷ௨ΓRESTfulͰɺ ϞμϯͳߏͰ͍ͯ͘͢ศརͰ͢Αʂ
Ͱ͜ͷࠜఈͷRESTʹ͍ͭͯ ཧղ͍ͯ͠·͔͢ʁ
POST͚ͩͰͳ͘PUT DELETE͕ΘΕ͍ͯͨΒ REST? ʁ
URLͷܗ͕ࣜͦΕͬΆ͍ͷ͕ REST? ʁ
JSON͕ଟ͍͚ΕͲJSONͩͬ ͨΒREST? ʁ
RESTԿΛͬͯREST? ʁ
ʮWP REST APIʯͱ͍͏Ϟϊ
͚ͩͰͳ͘
RESTͱ͍͏֓೦ΛѲ͢Δ
Կ͕REST͔Λ໌֬ʹ͠ɺ RESTful APIͷڞ௨ʹ͍ͭͯ Δ
ʮ͏࣌ʯʮ࡞Δ࣌ʯ྆ํͷ ֶशίετΛେ෯ʹݮΒ͢
ࠓͷΰʔϧ
ΞδΣϯμ • RESTʹ͍ͭͯ • RESTͷجຊݪଇʹ͍ͭͯ • ͓͖͍֮͑ͯͨผʹREST͡Όͳ͍ϧʔϧ • RESTݪཧओٛΛ؏͘߹ͷͭΒ͞ •
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ • ·ͱΊ
ΞδΣϯμ • RESTʹ͍ͭͯ • RESTͷجຊݪଇʹ͍ͭͯ • ͓͖͍֮͑ͯͨผʹREST͡Όͳ͍ϧʔϧ • RESTݪཧओٛΛ؏͘߹ͷͭΒ͞ •
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ • ·ͱΊ
RESTʹ͍ͭͯ
RESTͱʁ ݯྲྀʹ͍ͭͯ • 2000ʹఏএ͞ΕͨจΛݯྲྀͱ͢ΔWeb։ൃʹ͓͚Δελ Πϧͷݺশ • ݱతͳWeb։ൃɺಛʹAPI։ൃͷͰओྲྀͱͳ͍ͬͯΔ • ࠓʹͳͬͯྲྀߦ͍ͬͯΔͷΞϓϦ։ൃɾSPA։ൃͳͲ͕ྗ ΛڧΊͨ͜ͱʹΑͬͯΫϥΠΞϯτɾαʔόʔϞσϧʹ͓͚
ΔͦΕͧΕ͕໌֬ʹ͠͡ΊͨͳͲ͕ཧ༝ https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
RESTͱʁ ҙ • RESTࣗମ༷Ͱͳ͚ΕΞʔΩςΫνϟͰͳ͘ɺطଘ ͷ֓೦ͷू·ΓͰ͋Δ • ҰԠ໌֬ͳఆٛଘࡏ͢Δ͕ɺ͋͘·Ͱ֓೦తͳͷͰ͋ Δ
ΞδΣϯμ • RESTʹ͍ͭͯ • RESTͷجຊݪଇʹ͍ͭͯ • ͓͖͍֮͑ͯͨผʹREST͡Όͳ͍ϧʔϧ • RESTݪཧओٛΛ؏͘߹ͷͭΒ͞ •
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ • ·ͱΊ
RESTͷجຊݪଇʹ͍ͭͯ
RESTͷجຊݪଇʹ͍ͭͯ ࠷ݶѲ͓ͯ͘͠ͱྑ͍ݪଇ • εςʔτϨεͳΠϯλʔϑΣʔε • Ϧιʔεࢸ্ओٛʹΑΔҰҙͳࣝผࢠͷURIܗࣜͰͷఏڙ • Ϧιʔεʹରͯ͠ͷHTTPϝιουϕʔεͰͷૢ࡞ • ͦΕͧΕͷϦιʔεͷΞΫηεઌͷϦϯΫͷఆٛ
RESTͷجຊݪଇʹ͍ͭͯ εςʔτϨε • શͯͷHTTPϦΫΤετʹ͓͍ͯͦͷ௨৴ʹඞཁͳใ͕શͯ ؚ·Ε͍ͯΔ • ͯ͢ͷ௨৴ಠཱ͓ͯ͠ΓɺͦΕͧΕ͕લޙͷίϯςΩε τʹ͍ͭͯѲ͍ͯ͠Δඞཁ͕ͳ͍
RESTͷجຊݪଇʹ͍ͭͯ Ϧιʔεओٛ • RESTશͯͷΞΫηεͷతޠΛϦιʔεͱͯ͠ఆ͍ٛͯ͠ Δ( `posts`, `users` ͳͲ) • RESTʹ͓͍ͯɺ͜ΕΒͷϦιʔεશͯඞͣҰҙͳࣝผࢠ
Λ࣋ͪɺΞΫηε͕ՄೳͰ͋Δ(ྫ: /posts/1 )
RESTͷجຊݪଇʹ͍ͭͯ HTTPϝιουϕʔεͰͷΞΫηε • RESTͷϦιʔεͷૢ࡞ϙϐϡϥʔ͔ͭ࠷খݶͷ໋ྩηοτʹ Αͬͯදݱ͞ΕΔ • ΑΓ࣮ʹ͍ۙݺশͰHTTPͷ GET , POST
, PUT , DELETE ͷ4छΛ ར༻͢Δ • ͜Εඞͣ͠CRUDͱରԠ͢ΔͷͰͳ͍ • ͱ͍͑WordPressͷΑ͏ͳൺֱతϦϨʔγϣϯ͕؆ܿͳγεςϜʹ ͓͍ͯCRUDͱͷϚοϐϯάͱͳΓ͕ͪ
RESTͷجຊݪଇʹ͍ͭͯ ϦιʔεͷϋΠύʔϦϯΫ • ϦιʔεͷΞΫηε࣌ɺΞϓϦέʔγϣϯʹؔ͢Δใঢ় ଶͷมԽʹ͍ͭͯͷϦϯΫΛఏڙ͢Δ • ͋ΔಛఆͷϦιʔεΞΫηε͢ΔࡍɺͦͷϦιʔεͱؔ ࿈͢ΔϦιʔεͱΞΫηε͢Δ࣌ʹ୯७ʹͦͷϨεϙϯ εʹؚ·ΕΔϦϯΫΛḷΔ͚ͩͰྑ͍ •
ݪཧओٛͱͯ͠ɺಛఆͷΤϯυϙΠϯτʹΞΫηεͨ࣌͠ ͰؔΘΔϦιʔε͕શͯӾཡͰ͖Δ
ΞδΣϯμ • RESTʹ͍ͭͯ • RESTͷجຊݪଇʹ͍ͭͯ • ͓͖͍֮͑ͯͨผʹREST͡Όͳ͍ϧʔϧ • RESTݪཧओٛΛ؏͘߹ͷͭΒ͞ •
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ • ·ͱΊ
͓͖͍֮͑ͯͨ ผʹREST͡Όͳ͍ϧʔϧ
REST͡Όͳ͍ϧʔϧ ͜ΕΒRESTͷඞਢཁ݅Ͱͳ͍ • JSON͕ඞਢͰͳ͍ • HTTPͷεςʔλείʔυΛ༗ޮ׆༻͢Δ͜ͱඞਢͰͳ͍ • BearerೝূඞਢͰͳ͍ • Ϧιʔε͕ෳܗͰ͋Δ͜ͱಛʹඞਢͰͳ͍
• όʔδϣχϯάඞਢͰͳ͍
REST͡Όͳ͍ϧʔϧ JSON͕ඞਢͰͳ͍ • JSONRESTͷඞਢཁ݅Ͱͳ͍ • ͳΜͰJSONͱͯ͠ఏڙ͞Ε͍ͯΔͨΊޡղ͕ͪ͠ • ݱʹɺRESTͷఏএऀ͕ޙʹ͍͋͛ͯΔʮRESTͷख़ʯͷ αϯϓϧXMLͰهड़͞Ε͍ͯΔ https://www.infoq.com/jp/news/2010/03/RESTLevels
REST͡Όͳ͍ϧʔϧ HTTPͷεςʔλείʔυΛ࠷େݶ׆༻͢Δඞཁͳ͍ • RESTࣗମ͕HTTPͷຊདྷͷػೳΛ࠷େݶ׆༻͢ΔΑ͏ʹ࡞Β Ε͍ͯΔͷͰؒҧ͍Ͱͳ͍ • ͱ͍͑͜Εࣗମඞͣ͠ར༻͠ͳ͚ΕͳΒͳ͍Θ͚Ͱ ͳ͍ • ϓϥάϚςΟοΫͳͱͯ͠ਖ਼͍͠
REST͡Όͳ͍ϧʔϧ BearerೝূඞਢͰͳ͍ • OAuth / BearerͰͷೝূʹΑͬͯRESTful APIͷೝূߦΘΕ ͕ͪͰ͋Δ͕ɺBearerࣗମඞਢͰͳ͍ • ͦͦ
Authorization ϔομʔΛ༩͍ͯ͠Δ͜ͱεςʔ τϨεͷ͔݅Βҳ͍ͯ͠ΔͷͰʁ • ͜ΕϓϥάϚςΟοΫͳͱͯ͠ਖ਼͍͠
REST͡Όͳ͍ϧʔϧ Ϧιʔε͕ෳܗͰ͋Δ͜ͱඞਢͰͳ͍ • ಛʹඞਢͰͳ͍ • ωοτ্ʹΑ͘ʮRESTfulͳAPIͷ։ൃͰશͯෳܗʹ͠ ·͠ΐ͏ʯͱ͋Δ͕ͦΕࣗମϕετϓϥΫςΟεͰ͋Δ • ϓϥάϚςΟοΫͳͱͯ͠ਖ਼͍͠
REST͡Όͳ͍ϧʔϧ όʔδϣχϯάඞਢͰͳ͍ • `/api/v1/` ͷΑ͏ͳߏΑ͘ݟΔ͕ඞਢͰͳ͍ • རศੑΛߟ͑Δͱ͋ͬͨ΄͏͕ྑ͍͜ͱؒҧ͍ͳ͍ • ϓϥάϚςΟοΫͳͱͯ͠ਖ਼͍͠
ΞδΣϯμ • RESTʹ͍ͭͯ • RESTͷجຊݪଇʹ͍ͭͯ • ͓͖͍֮͑ͯͨผʹREST͡Όͳ͍ϧʔϧ • RESTݪཧओٛΛ؏͘߹ͷͭΒ͞ •
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ • ·ͱΊ
RESTݪཧओٛΛ؏͘߹ͷ ͭΒ͞
RESTݪཧओٛΛ؏͘߹ͷͭΒ͞ ೝূͲ͏͢ΔͶΜ • CookieηογϣϯʹΑͬͯϦΫΤετͰԣஅతͳίϯς Ωετ͕ੜ·Εͨ࣌ͰεςʔτϨεͰͳ͍ • ਖ਼͘͠εςʔτϨεͰ͋ΔͨΊʹೝূΛίϯςΩετʹґ ଘ͠ͳ͍ܗʹ͢Δඞཁ͕͋Δ • Authorization
ϔομʔΛར༻ͯ͠ Bearer ೝূ͕ϝδϟʔͰ ͋Δ͕ɺ͜ΕࣗೝূΛඞཁͱ͍ͯ͠Δ
RESTݪཧओٛΛ؏͘߹ͷͭΒ͞ /search?q= Ͳ͏͢ΔͶΜ • RESTʹ͓͍ͯɺURIͷରͱͳΔͷશͯϦιʔεͱͳΔͨ Ίɺ͜ΕతޠͱͳΔ໊ࢺͰ͋Δ͖Ͱ͋Δ • ͦͷதͰݕࡧΛදݱ͢Δ߹ɺ `search` ͱ͍͏୯ޠಉࢤͰ͋
ΔͨΊෆ߹͕ੜ͡Δ • Ұͭʹ /users?q= ͱ͍͏ղܾํ๏ΛͱΔ͜ͱՄೳͰ͋Δ͕ɺ ҰํͰ /users ͷऔಘʹ͔͔Δίετ্࣮ͷେ͖͍
RESTݪཧओٛΛ؏͘߹ͷͭΒ͞ ͜ΕΒʹ͍ͭͯͷղܾํ๏ • جຊతʹ REST API ͷݪଇͱͳΔ֓೦Ͱ͋ΔҎ্ͷҙຯ ࣋ͨͳ͍ͷͰɺʮRESTͬΆ͘ʯར༻ऀ͕ѻ͍͍͢ܗͰఏ ڙ͢Δ͜ͱ͕ཧ
• ࠷ऴతʹAPIΛར༻͢Δͷ API ϢʔβʔͱͳΔਓؒͳͷ Ͱਓؒʹѻ͍͍͢ܗͰ࡞Δ΄͏͕ྑ͍
Qiita API ඇ REST Ͱ͋Δ͕ൺֱత REST ʹ͍ۙ I/F Λఏڙ͍ͯ͠Δ
Qiita API ඇ REST Ͱ͋Δ͕ൺֱత REST ʹ͍ۙ I/F Λఏڙ͍ͯ͠Δ
esa API ඇ REST Ͱ͋Δ͕ൺֱత REST ʹ͍ۙ I/F Λఏڙ͍ͯ͠Δ
esa API ඇ REST Ͱ͋Δ͕ൺֱత REST ʹ͍ۙ I/F Λఏڙ͍ͯ͠Δ
ΞδΣϯμ • RESTʹ͍ͭͯ • RESTͷجຊݪଇʹ͍ͭͯ • ͓͖͍֮͑ͯͨผʹREST͡Όͳ͍ϧʔϧ • RESTݪཧओٛΛ؏͘߹ͷͭΒ͞ •
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ • ·ͱΊ
WP REST APIʹ͓͚Δ RESTͱͷ͖߹͍ํ
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ WP REST APIՄೳͳݶΓRESTͷ֓೦Λ९क͍ͯ͠Δ • WP REST APIRESTfulͰ͋Δ͜ͱΛࢸ্ͱͯ͠࡞͞Ε͍ͯ
Δ • WP REST APIɺRESTͰରॲ͖͠Εͳ͍ʹ͍ͭͯɺՄ ೳͳݶΓRESTΛ९क͢ΔΑ͏ਐΊ͍ͯΔ • ͱ͍࣮͑ࡍͱͯ͠ෆՄೳͳͱ͜Ζʹଥڠ͋Δ
WP REST APIͷREST९कʹ͍ͭͯͷઆ໌
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ جຊతͳར༻ʹ͍ͭͯ • WP REST APIɺWordPress͕ͭେͳϦιʔεʹ͍ͭͯ جຊతͳૢ࡞ΛRESTʹԊͬͨܗͰఏڙ͍ͯ͠Δ •
ྫ͑ɺ [GET] /posts ʹͯ ߘͷҰཡͷऔಘΛɺ [GET] / posts/<id> ʹͯ୯ҰͷߘͷऔಘΛɺ [POST] /posts ʹͯ ߘͷ࡞Λߦ͏͜ͱ͕Մೳɻ • ͜ΕΒ͕ΧςΰϦɾϢʔβʔɾݻఆϖʔδͳͲͦΕͧΕʹର ͯ͠ఏڙ͞Ε͍ͯΔ
WP REST APIͷجຊతͳϦΫΤετʹ͍ͭͯͷpayload, response
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ Searchʹ͍ͭͯ • WordPressͰRESTʹ͙ͦΘͳ͍ /search ܥͷΤϯυϙΠ ϯτͰͳ͘ɺ /posts
ͷ֦ுͱ͍͏ܗͰߦ͍ͬͯΔ • /posts?search= ͱ͍͏ܗࣜʹͯݕࡧ͕Մೳͱͳ͍ͬͯΔ • ͜ΕࣗମϦιʔεͱਖ਼͘͠Ϛον͓ͯ͠Γɺ͔ͭGETʹͯ ϦιʔεͷมԽ͕ߦΘΕͳ͍ͷͰਖ਼͍͠ͱ͍͑Δ
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ ೝূʹ͍ͭͯ • WP REST APIͰɺೝূΛ OAuth, Basic,
ͦͯ͠CookieͰ ߦ͍ͬͯΔ
WP REST APIʹ͓͚Δೝূํ๏ͷछผʹ͍ͭͯ
WP REST APIʹ͓͚Δೝূํ๏ͷछผʹ͍ͭͯ
WP REST APIʹ͓͚Δೝূํ๏ͷछผʹ͍ͭͯ
WP REST APIʹ͓͚Δೝূํ๏ͷछผʹ͍ͭͯ
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ ೝূʹ͍ͭͯ • WP REST APIͰɺೝূΛ OAuth, Basic,
ͦͯ͠CookieͰߦͬ ͍ͯΔ • Cookieʹ͍ͭͯεςʔτϨεͱݴ্͍͍ɺଞͷೝ ূ௨৴ʹίϯςΩετΛඞཁͱ͢Δ • WordPressͱ͍͏Ϧιʔεͷ࡞ʹ੍ݶΛ՝͢ͱ͍͏Ϟνϕʔ γϣϯʹ͓͍ͯؒҧ͍Ͱͳ͍ʢؾ͕͢Δʣ • ݱʹ͓͍ͯ͜͜ʹର͢Δਖ਼͍͠ιϦϡʔγϣϯͳ͍
ΞδΣϯμ • RESTʹ͍ͭͯ • RESTͷجຊݪଇʹ͍ͭͯ • ͓͖͍֮͑ͯͨผʹREST͡Όͳ͍ϧʔϧ • RESTݪཧओٛΛ؏͘߹ͷͭΒ͞ •
WP REST APIʹ͓͚ΔRESTͱͷ͖߹͍ํ • ·ͱΊ
·ͱΊ
·ͱΊ ᶃ RESTͷجຊ • REST͍·͔Β15Ҏ্લʹఏএ͞ΕͨWeb։ൃͷઃܭελΠϧ Ͱ͋Δ • RESTͷେ͖ͳಛͱͯ͠ɺҎԼͷ༷ͳͷ͕͋Δ • GET,
POST, PUT, DELETEΛར༻ͨ͠Ϧιʔεૢ࡞͕ఏڙ͞Ε͍ͯΔ • εςʔτϨεͰ͋Δ͜ͱʹΑΔѻ͍͍͢I/F͕ఏڙ͞Ε͍ͯΔ • ϦιʔεओٛͰ͋Δ͜ͱʹΑΓURIʹͯશ͕ͯ໌ࣔ͞Ε͍ͯΔ
·ͱΊ ᶄ ͭΒ͞ • RESTकΓ͗͢ΔͱͭΒ͍ • ਖ਼͍͠RESTfulઃܭਖ਼͍͠WebαʔϏεɾWebαΠτͷઃ ܭͰ͋ΔͱݶΒͳ͍ • ࠷ऴతʹར༻͢Δଆͷઢʹཱͬͯߏங͢Δ͜ͱ͕ॏཁ
·ͱΊ ᶅ WordPress • WP REST APIRESTͷجຊ෦क͍ͬͯΔͷͰRESTͷΠ ϝʔδ௨Γʹୟ͘ͱେͷૢ࡞ظ௨Γʹಈ͘ • جຊʹ࣮ͳ࡞ΓͰ͋ΔͷͰɺRESTʹֶ͍ͭͯͿʹஸ
ྑ͍ࢿྉͱͳ͍ͬͯΔ • ͱ͍͑Ұ෦CookieೝূͳͲଥڠ͕͋ΔͨΊશ͕ͯRESTful ͔ͱݴΘΕΔͱͦ͏Ͱͳ͍
͓ΘΓʹ
·ͱΊ • RESTͷجຊతͳಛϞμϯͳWebαʔϏεͰRESTͰͳ ͘ͱ࠾༻͞Ε͍ͯΔ • RESTͷجຊΛ͓֮͑ͯ͘ͱ༷ʑͳαʔϏεΛར༻͢Δࡍͷֶ शίετͷݮʹܨ͕Δ • ͱ͍͑࡞͢Δ߹ݻࣥ͗͢͠ͳ͍Α͏ʹ͠·͠ΐ͏
Ε͍ͯ·͕ͨ͠
ࣗݾհ Ֆ୩ຏ a.k.a @potato4d • དྷਓ͠·͢ • େࡕੜ·Εେࡕҭͪौ୩ࡏॅ • ීஈϑϩϯτΤϯυΤϯδχΞ
• ͱ͖Ͳ͖PHPͱ͔ॻ͍ͯ·͢ • PHPΧϯϑΝϨϯε2017Ͱొஃ͢Δͷ ͰԠԉ͍ͯͩ͘͠͞