Design the PUT Endpoint for Updating an Existing Product
Understand the PUT method and design the products API to update an existing product.
To update an existing entry in the collection, we use the PUT method.
Updating an existing product
So, PUT can be used for creating a new product as well as updating an existing product. However, creating a new product using PUT is not generally recommended or practised.
Based on the above definition, the following are the main features of the PUT method:
- The Request-URI refers to an existing item.
- The entity provided within the body has to be used