You can easily test a web service by making GET requests, using a browser.
In Chrome, in the address bar, enter the following URL:
http://localhost:5000/api/customers
You should see a JSON document returned, containing all the 91 customers in the Northwind
database, as shown in the following screenshot:
In the address bar, enter the following URL:
http://localhost:5000/api/customers/alfki
You should see a JSON document returned containing only the customer named Alfreds Futterkiste
, as shown in the following screenshot:
In the address bar, enter the following URL:
http://localhost:5000/api/customers/?country=Germany
You should see a JSON document returned, containing the customers in Germany, as shown in the following screenshot:
But how can we test the other HTTP methods, such as POST
, PUT
, and DELETE
? And how can we document our web service so it's easy for anyone to understand how to interact...