O'Reilly logo

Hands-On Full Stack Web Development with Aurelia by Erikson Haziz Murrugarra Sifuentes, Diego Jose Arguelles Rojas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

HTTP verbs for CRUD

Now that you have designed clean endpoints for your API, it is time to take advantage of what we learned about HTTP verbs. You might be asking yourself how do you differentiate when you want to create, update, or delete a product if you are using the same endpoint, /products? This is the case where we use HTTP verbs. For example, for the /products endpoint, we will have something like the following verbs:

Endpoint HTTP Verb Goal
/products POST To create a new product
/products PUT To update an existing product
/products DELETE To delete an existing product

 

So from the preceding table, you can note that the key differentiator is the HTTP Verb. In short, an endpoint is composed by one path and an HTTP Verb. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required