We build a CRUD REST API from scratch using .NET 7. As you would expect, the backend system supports Creating, Reading, Updating and Deleting food.
POST /food
{
"name": "Non-Vegan Sunshine",
"description": "Non-Vegan everything! Join us for a healthy food..",
"startDateTime": "2022-04-08T08:00:00",
"endDateTime": "2022-04-08T11:00:00",
"savory": [
"Oatmeal",
"Avocado Toast",
"Omelette",
"Salad"
],
"Sweet": [
"Cookie"
]
}
201 Created
Location: {{host}}/food/{{id}}
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Non-Vegan Sunshine",
"description": "Non-Vegan everything! Join us for a healthy food..",
"startDateTime": "2022-04-08T08:00:00",
"endDateTime": "2022-04-08T11:00:00",
"lastModifiedDateTime": "2022-04-06T12:00:00",
"savory": [
"Oatmeal",
"Avocado Toast",
"Omelette",
"Salad"
],
"Sweet": [
"Cookie"
]
}
GET /food/{{id}}
200 Ok
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Vegan Sunshine",
"description": "Vegan everything! Join us for a healthy food..",
"startDateTime": "2022-04-08T08:00:00",
"endDateTime": "2022-04-08T11:00:00",
"lastModifiedDateTime": "2022-04-06T12:00:00",
"savory": [
"Oatmeal",
"Avocado Toast",
"Omelette",
"Salad"
],
"Sweet": [
"Cookie"
]
}
PUT /food/{{id}}
{
"name": "Vegan Sunshine",
"description": "Vegan everything! Join us for a healthy food..",
"startDateTime": "2022-04-08T08:00:00",
"endDateTime": "2022-04-08T11:00:00",
"savory": [
"Oatmeal",
"Avocado Toast",
"Omelette",
"Salads"
],
"Sweet": [
"Cookie"
]
}
204 No Content
or
201 Created
Location: {{host}}/food/{{id}}
DELETE /food/{{id}}
204 No Content
-
VSCode Rest Client - REST Client allows you to send HTTP request and view the response in Visual Studio Code directly.
-
VSCode Markdown Preview Enhanced - Markdown Preview Enhanced is an extension that provides you with many useful functionalities for previewing markdown files.