Reviewing the Web Service’s Functionality
Learn about testing a web service’s functionality by configuring launch settings, navigating to different endpoints, and verifying responses.
We'll cover the following...
We'll cover the following...
Test the web service
Now, we will test the web service’s functionality:
Step 1: In the Properties
folder, open the launchSettings.json
file, and note that by default, if we are using Visual Studio 2022, it will launch the browser and navigate to the /swagger
relative URL path, as shown in the following markup:
Press + to interact
"profiles": {"http": {"commandName": "Project","dotnetRunMessages": true,"launchBrowser": true,"launchUrl": "swagger","applicationUrl": "http://0.0.0.0:5000","environmentVariables": {"ASPNETCORE_ENVIRONMENT": "Development"}},"https": {"commandName": "Project","dotnetRunMessages": true,"launchBrowser": true,"launchUrl": "swagger","applicationUrl": "https://0.0.0.0:5001;http://0.0.0.0:5000","environmentVariables": {"ASPNETCORE_ENVIRONMENT": "Development"}},}
Step 2: Modify the profiles named http
and https
to set launchBrowser
to false.
Step 3: For the profiles named http
and https
for the applicationUrl
, change the random port number for HTTPS to