ASP.NET + REST API + Swagger Doc UI
Understanding REST API with ASP.NET
Adazolhub shop product api endpoints to perform CRUD operation on the backend through REST API.
Implemented Swagger UI for developer friendly test endpoints
Using terminal console to test API endpoints
Setup
- Initialize Webapi
dotnet new webapi -f net6.0
- install HTTP requests tools to test ASP.NET Core web APIs on console/terminal
dotnet tool install -g Microsoft.dotnet-httprepl
- Install Local Development Certificate
dotnet dev-certs https --trust
- Run Webapi
dotnet run
- Start test request to endpoints
# start connection
httprepl https://localhost:{PORT}
# connnect to endpoint
(Disconnected)> connect https://localhost:{PORT}
# navigate to specific endpoint
cd <Name_OF_Endpoint>
# request using "GET" method
get