The POST method is used to send data to the server to create a new resource. GET is for fetching data, PUT is for updating, and DELETE is for removing.
PUT replaces the entire resource with the data sent. PATCH is for partial updates, POST is for creating, and GET is for reading.
app.delete defines a route that listens for DELETE requests, which is the correct method for deleting resources. Other methods are for different actions.
200 OK means the update was successful and the server is returning the updated resource or confirmation. 201 is for creation, 204 means success with no content, and 404 means resource not found.
PUT is idempotent because updating a resource with the same data multiple times results in the same state. POST is not idempotent because it creates new resources each time. PATCH may not be idempotent depending on the patch. DELETE is idempotent because deleting the same resource multiple times has the same effect as deleting once.