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

Verbs

The HTTP verbs are the magic behind RESTful APIs. Let's use an example to understand how HTTP verbs works. We want to create an API to manage products; our first version might look like this:

Endpoint HTTP verb Goal
http://myapp/api/createProduct POST To create a product
http://myapp/api/updateProduct/P1 POST To update an existing product
http://myapp/api/listProducts GET To retrieve the complete list of products
http://myapp/api/viewProductDetails/P1 GET To retrieve a single product
http://myapp/api/deleteProduct/P1 POST To delete a product

 

From the preceding table, you can note that we need to remember five endpoints, and we are using two HTTP verbs: POST and GET. It might be understood that every time we want to ...

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