A POST request asks a server to process something according to the meaning of the targeted resource. In a REST API, POST commonly creates an element in a collection, but it can also represent actions such as starting or sending something. The method says what kind of interaction is requested; the path identifies the resource that receives it. section 4.3.1 section 3.1.1
Add a product to a catalog
Use POST /products to add a product. The server creates it and returns a reference that the consumer can use with GET /products/{Product reference}. POST lets the system generate that reference, avoiding collisions when product references would otherwise be random numbers. section 4.3.5
The usual collection pattern is POST /elements to create an element, then GET /elements/{element identifier} to read it. A meaningful collection path also makes an API easier to guess: POST /customers suggests adding a customer more clearly than POST /add-customer. section 4.3.6 section 9.3.1
Choose the method by the operation, not just by whether data is sent:
- Use GET to read or search; do not use it to modify data. section 4.3.1 section 9.3.1
- Consider PUT /elements/{element identifier} for creation when the consumer supplies the identifier, or PUT or PATCH for updates. section 4.3.5 section 4.3.6
- Use DELETE for deletion rather than disguising it as a POST action. section 4.3.1 section 9.3.1
Take care when retrying POST. Identical POST requests are not idempotent: replaying POST /transfers can create multiple money transfers. Before choosing an automatic retry, consider what repeating the operation would do to server state. section 12.5.2














