Before diving into our ultimate goal, some foundational knowledge is required. Today I will do a practice for building a simple .Net WEB API.

Create a new project

Search “API” -> select ASP. NET Core Web API -> Next

Input project name “CustomerAPI” -> Next

Select .Net 8.0 (Long Term Support) -> Create

After creating the project, we can see visiual studio have already help us to generate some template files.

File name
launchSettings.jsonproject setting file
Program.csMain program file
CustomerAPI.httpDefault http file
Now, we can test our project is work or not, simply press the start button (without debugging)

A Swagger page will show up

We can check the respones data here

If not, I suggest go to chrome://flags/, to Enable the “Allow invalid certificates for resources loaded from localhost”. To allow browser access the localhost resource without certificates.

Or you can put the link {@CustomerAPI_HostAddress}/WeatherForecast to the search bar of the browser or Postman

For the request link, you can copy it from swagger

or go to launchSettings.json to find out the {@CustomerAPI_HostAddress} under “profiles ->https”

We will our own date for API tomorrow.