RESTful Actions

Kellen May
1 min readMar 25, 2021

If you are struggling to understand what a restful action is, don’t worry I did too. Its a hard concept to visualize. I have an easy way to understand these actions and how you as a developer can better understand why we rely on RESTful routes.

What we need to consider is, how are we going to set up our code? A restful route is just making sure we follow a naming convention for ease of use. Meaning when we CRUD(create, read, update, and destroy) those actions have the HTTP methods (Get, Post, Put/Patch, and Delete).

So let’s say we want our users to be able have a blog like Medium… the user should be able to Create a new blog post (Get a new form and Post that new blog post to a route like user/blog_post/new), the blog post should be able to be Read alone (Get the blog route user/blog_post/:id), the user should be able to Update that blog post as well (Put/Patch the blog post user/blog_post/:id/edit) and also be able to Destroy the blog post (Delete /user/blog_post/:id).

So a RESTful route is just a way to build your code so it has a more consistent logic to understand.

--

--

Kellen May
0 Followers

current software engineering student with flatiron here to document my progress