This Example Minimal API uses sql (SqlServer) With the help of WEB ASP NET CORE, this REST API is an experiment in building a simple REST API. Later this API will be FETCHed with React JS
Clone the project into your local directory
git clone https://github.com/WayanBerdyanto/72210481_UTS.git
Install SQL SERVER you can install visit in SqlServer Download
See Documentation
dotnet watch run
- URL:
https://localhost:5222/api/getAllCategory
- Method: GET
{
"success": true,
"message": "request update successful",
"data": [
{
"categoryID": 1,
"categoryName": "Food"
},
{
"categoryID": 2,
"categoryName": "Drink"
}
]
}
- URL:
https://localhost:5222/api/getCategoryById/{id}
- Method: GET
{
"success": true,
"message": "request data successful",
"data": [
{
"categoryID": 1,
"categoryName": "Food"
}
]
}
- URL:
https://localhost:5222/api/getCategory/search/{categoryName}
- Method: GET
{
"success": true,
"message": "request successful",
"data": [
{
"categoryID": 1,
"categoryName": "Food"
}
]
}
- URL:
https://localhost:5222/api/category
- Method: POST
{
"categoryName": "Pizza"
}
{
"categoryID": 0,
"categoryName": "Pizza"
}
- URL:
https://localhost:5222/api/category
- Method: PUT
{
"categoryID": 3,
"categoryName": "Burger"
}
{
"success": true,
"message": "request update successful",
"data": {
"categoryID": 3,
"categoryName": "Burger"
}
}
- URL:
https://localhost:5222/api/category
- Method: DELETE
{
"categoryID": 3,
}
{
"success": true,
"message": "request delete successful"
}