tubeshowcase●913,523 videos♡ My collection 0
← Learn to Code

Learn to Code03:24

What is REST?

Web Dev Simplified ↗

From the creator

If you have used any modern website, then chances are you have interacted with a website that uses REST. Even YouTube uses RESTful URLs on its site, but what exactly is REST? For starters, REST stands for Representation State Transfer and is just a fancy way of saying that a server responds to create, read, update, and delete requests in a standard way. The idea behind REST is to treat all server URLs as access points for the various resources on the server. For example in this URL, http://example.com/users, users represents the resource that the server is exposing. As mentioned earlier, REST needs a way to create, read, update, and delete these resources and it does so with the following five URLs. http://example.com/users http://example.com/users http://example.com/users/1 http://example.com/users/1 http://example.com/users/1 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. [GET] http://example.com/users [POST] http://example.com/users [GET] http://example.com/users/1 [PUT] http://example.com/users/1 [DELETE] http://example.com/users/1 The first URL we have is the GET

Published 2019-04-02 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code