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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Joël Cox
October 18, 2023
Programming
22
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
650
Deploying large scale web applications
joelcox
1
270
Other Decks in Programming
See All in Programming
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
さぁV100、メモリをお食べ・・・
nilpe
0
140
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.2k
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
160
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
Lessons from Spec-Driven Development
simas
PRO
0
210
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
550
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
120
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
190
JavaDoc 再入門
nagise
1
360
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
140
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Done Done
chrislema
186
16k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
200
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
WENDY [Excerpt]
tessaabrams
11
38k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Context Engineering - Making Every Token Count
addyosmani
9
970
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
420
Navigating Weather and Climate Data
rabernat
0
220
Building a Scalable Design System with Sketch
lauravandoore
463
34k
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]