Specifying the API
The very first thing a project usually starts with is a definition of the operations the API will expose. According to the REST principles, an operation is exposed by an HTTP method and a URI. The action performed by each operation should not contradict the natural meaning of its HTTP method. The following table specifies the operations of our API in detail:
Method | URI | Description |
|
| Retrieves all available categories in the catalog. |
|
| Retrieves all the items available under a specific category. |
| | Retrieves an item by its ID under a specific category. |
|
| Creates a new category; if it exists, it will update it. |
|
| Creates a new item in a specified category. If the item exists, it will update it. |
| | Updates a category. |
|
| Updates an item in a specified category. |
|
| Deletes an existing category... |