In previous post,i.e. How to do CRUD operations in asp.net WEB API we have already written the CRUD operation methods using WEB API, but on browser we cannot test all methods, we have to take help of some external tool like fiddler or postman tool for testing all the methods.
what is the postman tool ?
Postman is a Google Chrome app for interacting with HTTP APIs. It presents you with a friendly GUI for constructing requests and reading responses.
Using Postman we can easily test the rest enable service like web api.
How to Install the postman tool ?
>> Search the postman in google then install it
OR
download from given the path https://chrome.google.com/webstore/category/extensions?hl=en
How to test the WEB API Get method using postman ?
Step 1: Lunch the postman tool
Step 2: Give the URL of get method as given below image then click on Send button. You will get the result as given below.
If get method execute successfully, you will get status 200 OK.
How to test the WEB API POST method using postman ?
Step 1: Lunch the postman tool
Step 2: Give the URL of POST method as given below image then click on Send button. You will get the result as given below.
If get method execute successfully, you will get status 201 Created.
How to test the WEB API PUT method using postman ?
Step 1: Lunch the postman tool
Step 2: Give the URL of PUT method as given below image then click on Send button. You will get the result as given below.
How to test the WEB API Delete method using postman ?
Step 1: Lunch the postman tool
Step 2: Give the URL of DELETE method as given below image then click on Send button. You will get the result as given below.
If DELETE method execute successfully then you will get status 200 OK.