Documenting and Testing Web Services
Explore how to test web services in ASP.NET Core by sending HTTP requests using browsers and tools like REST Client. Understand documenting APIs with Swagger for better usability. This lesson helps you test GET, POST, PUT, and DELETE methods and ensures clear communication through API documentation.
We can easily test a web service by making HTTP GET requests using a browser. To test other HTTP methods, we need a more advanced tool.
Testing GET requests using a browser
We will use Chrome to test the three implementations of a GET request: for all customers, for customers in a specified country, and for a single customer using their unique customer ID:
Step 1: Start the Northwind.WebApi web service project.
Step 2: Start the browser.
Step 3: Navigate to https://localhost:5001/api/customers and note the JSON document returned, containing all 91 customers in the ...