What is REST?

preview_player
Показать описание

The first two URLs do not have an ID so they act on the entire user's resource, while the last three URLs do have an ID in their URL and thus act on only a single user resource, but as you may notice there are only two distinct URLs. That is because REST uses the four basic HTTP actions, GET, POST, PUT, and DELETE to determine what to do with each URL. If we add in those actions to the URLs it is much easier to see what each of the URLs do.

The first URL we have is the GET users URL, and it is used to get a list of all users. In REST when a GET URL does not have an ID it acts upon the entire resource and will always return a list of every item in that resource. The GET action in REST corresponds with reading data.

The second URL, which is almost identical to the first, is used to create a new user. In REST the POST action corresponds with creation, and should always be used on the entire resource by not using an ID in the URL.

The third URL is another GET URL, but this URL is for getting only a single user based on the id that is in the URL. The ID portion of the URL is used by REST to determine which resource from the collection of resources it should act upon. In the case of this URL it is used to return the user with that ID.

The fourth URL is the most confusing of them all, but it is used to update a user with the given ID. The PUT action in REST corresponds with update and works very similarly to POST, but instead of creating a new resource it updates an existing resource.

Lastly, we have the most straight forward URL of them all which is for deleting a user with a specific ID. The DELETE action in REST does exactly what you would think and deletes the resource with the given ID.

In order for a website to use REST, the URLs do not need to be formatted exactly the same as above. For example using these URLs would still be considered RESTful, but most applications will use the previously mentioned URLs.

The only thing that matters with REST is that the URLs used represent a resource, in this case a user, and that they support creating, reading, updating, and deleting from that resource using the HTTP actions GET, POST, PUT, and DELETE.

Previous Video:

Next Video:

Playlist:

Twitter:

GitHub:

CodePen:

#REST #WebDevelopment #RESTful
Рекомендации по теме
Комментарии
Автор

great one! now I'm gonna go rest... hehehe ( I know it's not funny).

developedbyed
Автор

You are just amazing. We didnt have a teacher like you in our school. We all mugged the code up and couldnt reproduce it as we didnt understand the logic. By looking at all your videos, I can say I am gaining the confidence to build a website

playboy
Автор

Youtube Search results about Web Dev, programming language tutorials usually shows old outdated videos which is hard to understand rather videos like this one. Your videos deserves definetely more likes. I would like to thank you for your hard work and effort. Im subscribed and looking forward for your next videos. Thank you again!

mahrig
Автор

The simplest and clearest explanation of REST. Thanks a lot!

javxa
Автор

I've read so many different explanations of REST and this is by far the clearest explanation. Thank You!

juvenalgonzalez
Автор

Hey WebDev this series looks really cool, I'm really looking forward to it. I subscribed a couple weeks ago because I thought you really knew your stuff so I'm excited to track this series. Let's go brother!

khandoor
Автор

It's been about 10 minutes since I first came to your channel and I am on my second video already! Great job and really loving it :)))

iconicbehaviour
Автор

This is probably the easiest way to explain REST. Definitely a genius to come up with this.

ShafiqNazrin
Автор

This was so simple, i was scratching my head reading all about it on the internet

karaokewaala
Автор

Great video! This is the best explanation of REST I have ever seen!

JM-tumg
Автор

Thank you! That was such a simple and straight to the point explanation!

rociodesantiago
Автор

Bro, this is a great. I can understand the difficulty and confusing of the REST in 3 mins. Keep doing your great work!

anthonytcool
Автор

Thank you, no one has explained that to me in such an efficient way.

tfilipow
Автор

Very clear and succinct introduction to RESTful APIs - Thank you, Kyle

{2021-06-07}, {2021-09-08}

Pareshbpatel
Автор

Thank you. The video is concise and straight to the point.

nwobodogeorge
Автор

Thanks, Kyle. Your videos really helps me to understand different topics. Btw, don't you mind if I translate some of your videos to Russian?

rgtkswv
Автор

Lovely tutorials, really simple. Greetings from Hungary :)

GaborNeogrady
Автор

Found your channel today. I'm already learning alot. thankiu

albertoazinar
Автор

I'm honored to learn from you. my sensei

johongirrahimov
Автор

Thank you my friend. I'm a beginner and your explanation was very clear. Best regards.

davidr.flores