How To Design Amazing REST APIs

  Рет қаралды 9,481

Amichai Mantinband

Amichai Mantinband

14 күн бұрын

Join us on Discord, get the source code (and support the channel 🙂): / amantinband
Clean Architecture Zero to Hero: dometrain.com/bundle/from-zer...
Domain-Driven Design Zero to Hero: dometrain.com/bundle/from-zer...
All videos in this playlist: • ASP.NET 8 REST API Tut...
In this video, we'll cover REST API design best practices!
We'll cover everything from URI and resource naming to idempotency, safety, and caching.
Connect with me on 'em socials:
Twitter: / amantinband
LinkedIn: / amantinband
GitHub: github.com/amantinband
Check out all my courses on DomeTrain:
dometrain.com/author/amichai-...
Support the channel and get the source code:
/ amantinband
Thanks for watching, don't forget to like & comment & subscribe! ❤️ 💻

Пікірлер: 22
@DamirSecki
@DamirSecki 11 күн бұрын
Great video! But missing important PATCH? Also woulde be important mentioning authorisation... with userId, where do we handle this (HEADER - usually with bearer token) and how to handle the not authorised response ... but in all, very quick, to the point video... cheers!
@ryan-heath
@ryan-heath 12 күн бұрын
Very concise and high quality. Love it!
@lucaciandrei
@lucaciandrei 12 күн бұрын
Yes, finally, more.
@Whojoo
@Whojoo 12 күн бұрын
Quick question, why was Patch skipped? I don't think it was mentioned in the video and it is a http method I see being used by several applications by different companies.
@amantinband
@amantinband 12 күн бұрын
I talked about it briefly but ended up cutting it due to time constraints
@stephenyork7318
@stephenyork7318 7 күн бұрын
Whenever I’ve worked somewhere building REST APIs we always avoided patch, seems to be hard to get right when ultimately PUT is adequate.
@hakura88
@hakura88 4 күн бұрын
@@stephenyork7318 we skip patch too, because we don't care that the complete resource is updated
@carlcodes8422
@carlcodes8422 12 күн бұрын
Love this video Amichai, very concise, and a great refresher for everyone!
@desenvolvimentoetecnologia
@desenvolvimentoetecnologia 12 күн бұрын
Nice content!! Can't wait for more of this!
@bartlomiejuminski
@bartlomiejuminski 12 күн бұрын
quality video thank You
@sauliustb
@sauliustb 6 күн бұрын
Nice overview, but this raises a question for me: If you should use plural nouns and some level of nesting, given a game, should moves for a player in a specific game then be POSTed to /games/{gameId}/players/{playerId}/moves, or should you do a POST to /moves with a json in the request body? Functionally both would work, but I can't figure out which is dogmatic..
@suhutwadiyo
@suhutwadiyo 12 күн бұрын
Mantappp
@tchial0
@tchial0 12 күн бұрын
Finally
@shahrukhqasim2770
@shahrukhqasim2770 10 күн бұрын
Is 201 created response okay if we are creating a collection of objects as the location header can only have the route for only one object created with the object's id but not the collection. Can you shed some light on it?
7 күн бұрын
I'm having doubts about DELETE being idempotent. It's counterpart (POST) is not, as it creates new entities, so unless you're soft-deleting (so basically - updating some deletion timestamp - a common practice) an entity, DELETE will not be idempotent. It will remove the entity on the first request, responding 204 and it should do nothing on the second request (with the same ID), returning 404, as it shows the true state the server is in after the first request. Different states and responses on the first and next requests for the same parameters. EDIT: For anyone confused, as I was: with DELETE the idempotency is kind of "delayed". The first request changes the server state, as it should, but the subsequent requests with the same ID parameter will not change the server state (as in: will not add/remove entities). In that way DELETE is idempotent. "Soft-delete" should still be treated on the same level as UPDATE request, though.
@ruekkart
@ruekkart 11 күн бұрын
Nice video! I'm thinking about DDD and CQRS integration. Is there any standard similar to REST but for task-oriented interfaces? Something like a task-oriented API? Or is it generally recommended to use just a task-oriented UI but a REST API under the hood?
@amantinband
@amantinband 9 күн бұрын
Not really. Perhaps gRPC is the closest. A common approach is implementing a "RESTful" API, but then converting the request internally to a command/query which is what's used to invoke the underlying task
@SerafimMakris
@SerafimMakris 12 күн бұрын
if someone ask me to explain the http again i will send it this url without subject or title. :D :D Tnx. Amichai for the content.
@muczos
@muczos 9 күн бұрын
Would be nice to have PATCH auth etc ... :
@tomazkoritnik4072
@tomazkoritnik4072 6 күн бұрын
With REST API design I always ask myself "why oh why?". Why using it, when there are so much simpler solutions. I use JsonRPC and is so much simpler, so much easier to understand and so much more natural to use. So, why? Don't get me wrong, one can build really bad APIs with RPC, therefore the API design is VERY important. I usually try to design APIs where a RPC request always targets an object. It's like calling an action on an object from the domain model. I think that HTTP is abused in REST and that API design is adapted to fit to HTTP instead of adapting API design to our domain. There is simply too much mapping needed between domain code and API code in REST and requires lots of documentation to understand it. We developers have more than enough complexity elsewhere to deal with. Also all mentioned for REST apply also to RPC: nesting, versioning, idempotency, even HATEOAS.
@Eirenarch
@Eirenarch 10 күн бұрын
I disagree with the /products/{productId}/reviews/{reviewId} URL. If you have reviewId it goes under /reviews/{reviewId}. Why make the user provide 2 different IDs? What happens if they mismatch? Why allow a situation where we need to answer these questions at all?
The 3 REST API Maturity Levels (The Richardson Maturity Model)
2:43
Amichai Mantinband
Рет қаралды 4,9 М.
Stop Calling Your API a "REST API"
17:42
Amichai Mantinband
Рет қаралды 13 М.
CAN YOU HELP ME? (ROAD TO 100 MLN!) #shorts
00:26
PANDA BOI
Рет қаралды 36 МЛН
100😭🎉 #thankyou
00:28
はじめしゃちょー(hajime)
Рет қаралды 40 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 48 МЛН
Dynamic #gadgets for math genius! #maths
00:29
FLIP FLOP Hacks
Рет қаралды 18 МЛН
Good APIs Vs Bad APIs: 7 Tips for API Design
5:48
ByteByteGo
Рет қаралды 202 М.
Every Single LINQ Extension Method With Examples | .NET & C# Essentials
42:28
Exceptions are evil. This is what I do instead.
24:41
Amichai Mantinband
Рет қаралды 16 М.
Domain-Driven Design (DDD) Explained In 5 Minutes
5:08
Code & Cris
Рет қаралды 87
How to create your Golang APIs from now on with v1.22
12:51
GAME DEV Q/A 💜 Go Make Games 💛 !Heartbound !Website !TTS
Pirate Software
Рет қаралды 1,4 М.
What is an API Explained in 1 minute #shorts
0:46
Learn with Whiteboard
Рет қаралды 166 М.
ASP.NET 8 REST API Tutorial - The "Sweet Spot" Architecture
11:30
Amichai Mantinband
Рет қаралды 12 М.
The standard library now has all you need for advanced routing in Go.
13:52
Winglang in 10 minutes
11:39
Amichai Mantinband
Рет қаралды 10 М.
The power button can never be pressed!!
0:57
Maker Y
Рет қаралды 54 МЛН
Эффект Карбонаро и бумажный телефон
1:01
История одного вокалиста
Рет қаралды 2,6 МЛН
What percentage of charge is on your phone now? #entertainment
0:14
Топ-3 суперкрутых ПК из CompShop
1:00
CompShop Shorts
Рет қаралды 325 М.
Apple, как вас уделал Тюменский бренд CaseGuru? Конец удивил #caseguru #кейсгуру #наушники
0:54
CaseGuru / Наушники / Пылесосы / Смарт-часы /
Рет қаралды 4,5 МЛН