This RESTful API is designed to manage a pizza inventory. It provides various endpoints for interacting with pizza data, including retrieving a list of all pizzas, getting a pizza by its ID, adding a new pizza, updating an existing pizza, and deleting a pizza.
-
GET /Pizza: Get a list of all pizzas.
-
GET /Pizza/{id}: Get a pizza by its ID. Replace
{id}with the actual pizza ID. -
POST /Pizza: Add a new pizza. Provide the pizza data in the request body.
-
PUT /Pizza/{id}: Update an existing pizza by its ID. Replace
{id}with the actual pizza ID and provide the updated pizza data in the request body. -
DELETE /Pizza/{id}: Delete a pizza by its ID. Replace
{id}with the actual pizza ID.
Here are some example use cases for each endpoint:
- Request: GET /Pizza
- Response: Retrieve a JSON array containing all the pizzas in the inventory.
- Request: GET /Pizza/{id}
- Response: Retrieve a JSON object representing the pizza with the specified ID.
- Request: POST /Pizza
- Provide pizza data in the request body (e.g., name, description, price).
- Response: The newly added pizza is created and returned in the response.
- Request: PUT /Pizza/{id}
- Replace
{id}with the pizza's ID. - Provide the updated pizza data in the request body.
- Replace
- Response: The pizza with the specified ID is updated.
- Request: DELETE /Pizza/{id}
- Replace
{id}with the pizza's ID.
- Replace
- Response: The pizza with the specified ID is deleted from the inventory.
- Clone this repository or integrate the API into your .NET project.
- Make sure you have the required dependencies and packages installed.
- Run the application.
- Use your preferred API testing tool (e.g., Postman) to interact with the API using the provided endpoints.
Enjoy your pizza! 🍕