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:
|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 ...