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
Pixelpillow College Tour - HTTP APIs
Search
Joël Cox
October 18, 2023
Programming
24
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Pixelpillow College Tour - HTTP APIs
Joël Cox
October 18, 2023
More Decks by Joël Cox
See All by Joël Cox
Pixelpillow College Tour - Call me Maybe
joelcox
0
36
Pixelpillow College Tour - Grafen, automaten en reguliere talen
joelcox
0
66
CI Joe
joelcox
0
76
Shipping products in a start-up environment
joelcox
0
67
Measuring Dependency Freshness in Software Systems
joelcox
0
120
Why you should use a MV* framework
joelcox
2
630
(Really) naive data mining
joelcox
2
660
Deploying large scale web applications
joelcox
1
270
Other Decks in Programming
See All in Programming
数百円から始めるRuby電子工作
tarosay
0
130
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
210
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.6k
Foundation Models frameworkで画像分析
ryodeveloper
1
510
5分で問診!Composer セキュリティ健康診断
codmoninc
0
830
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
160
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.8k
霧の中の代数的エフェクト
funnyycat
1
460
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
130
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
3.5k
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
540
その節約、円になってますか?
isamumumu
1
670
Featured
See All Featured
A Tale of Four Properties
chriscoyier
163
24k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
450
Unsuck your backbone
ammeep
672
58k
エンジニアに許された特別な時間の終わり
watany
108
250k
Side Projects
sachag
455
43k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
We Are The Robots
honzajavorek
0
290
KATA
mclloyd
PRO
35
15k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
190
Transcript
Pixelpillow College Tour HTTP APIs
Waaaa tt t?!?! • HTTP als protocol. • Een communica
ti elaag tussen twee system.
HTTP is een… • URL – h tt ps://google.com/search?q=lmgt fy
• Methode – POST, PATH, DELETE • Headers – Content-Type: “applica ti on/json” • Body – { “foo”: “bar” } • Status code – 200 OK
Maar zegt niks over… • Structuur (zoals paden) • Transport
(HTML, XML, JSON, etc.)
Dus: smaakjes! • SOAP • RESTful • JSON-API • GraphQL
SOAP
SOAP
RESTful Stateless – Geen afhankelijkheden tussen opvolgende requests. Decoupled –
Geen aannames over gebruik door een client. Cacheable – En dus snel Uniform – Voorspelbaar!
RESTful requests GET /api/posts ! 200 OK POST /api/posts !
201 Created GET /api/posts/1 ! 200 OK PATCH /api/posts/12 ! 200 OK DELETE /api/posts/12 ! 410 Gone
RESTful is niet genoeg… Geen standaard, slechts principes 👎 Geen
ondersteuning voor “ac ti es” 🤔 Rela ti onele data is las ti g. 😭
JSON-API: Best of REST Een standaard! Vanuit de prak ti
jk ( fi lters, meta data, etc.) Rela ti es via links en included
{ "data": [ { "type": "articles", "id": "1", "attributes": {
“title": "JSON:API paints my bikeshed!" }, "relationships": { "author": { "links": { "self": "http://example.com/articles/1/relationships/author", "related": "http://example.com/articles/1/author" }, "data": { "type": "people", "id": "9" } }, "comments": { "links": { "self": "http://example.com/articles/1/relationships/comments", "related": "http://example.com/articles/1/comments" }, "data": [ { "type": "comments", "id": "5" }, { "type": "comments", "id": "12" } ] } }, "links": { "self": "http://example.com/articles/1" } }], "included": [{ "type": "people", "id": "9", "attributes": { "firstName": "Dan", "lastName": "Gebhardt", "twitter": "dgeb" },
{ "data": [ { "type": "articles", "id": "1", "attributes": {
"title": "JSON:API paints my bikeshed!" }, "relationships": { "author": { "links": { "self": "http://example.com/articles/1/relationships/author", "related": "http://example.com/articles/1/author" }, "data": { "type": "people", "id": "9" } }, "comments": { "links": { "self": "http://example.com/articles/1/relationships/comments", "related": "http://example.com/articles/1/comments" }, "data": [ { "type": "comments", "id": "5" }, { "type": "comments", "id": "12" } ] } }, "links": { "self": "http://example.com/articles/1" } }], "included": [{ "type": "people", "id": "9", "attributes": { "firstName": "Dan", "lastName": "Gebhardt", "twitter": "dgeb" },
JSON:API hee ft geen… Geen ondersteuning voor “ac ti es”
🤔 (bijv. het favoriten van een resource) Is niet self-documen ti ng… 📚
GraphQL Alles is een graaf™ Mutations en Queries
GraphQL Playground!!! https://www.apollographql.com/docs/apollo-server/v2/testing/graphql-playground/
Can’t have your cake and eat it too. Paradigma sluit
niet aan bij onze manier van backends bouwen.
Vragen? 038 750 3491
[email protected]