Documenting and trying out web services
You can easily try out a web service by making HTTP GET
requests using a browser. To try out other HTTP methods, we need a more advanced tool.
Trying out GET requests using a browser
You will use Chrome to try out 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:
- Start the
Northwind.WebApi
web service project using thehttps
launch profile. - Start Chrome, navigate to
https://localhost:5151/customers
, and note the JSON document returned, containing all 91 customers in the Northwind database (unsorted), as shown in Figure 15.2:
Figure 15.2: Customers from the Northwind database as a JSON document
- Navigate to
https://localhost:5151/customers/in/Germany
and note the JSON document returned, containing only the customers in Germany.
If you get an empty array []
returned...