Saturday, November 21, 2020

How to use POSTMAN to test Web API Services

 


How To Use Postman 


Let’s see how to use POSTMAN to send an HTTP request to our local ASP.NET Web API Services and check the response.


Step 1:  Download and install POSTMAN from Postman

Step 2: Once the Postman is successfully installed, open the Postman. It will look like the image shown below.

how to use POSTMAN to test web API Services


GET Request using Postman:

Select the HTTP Method as “GET” and enter the URL of your Web API as shown in the below image.

GET Request using Postman

Once you click on the Send button, an HTTP request is sent to the provided URL. The response coming from the Web API Server is displayed in the below image.

how to test Get Request Using POSTMAN

As you can see in the above image, the HTTP response shows data and response status. Thus, you can also use Postman to test your Web API.

POST Request using Postman:
  1. Choose the HTTP verb as POST
  2. Set the URL
  3. Set the Content-Type as application/json. To do this click on the Header tab and provide the key value as shown in the below image

POST Request using Postman

Next, we need to provide the string value that we want to add to the string array. We need to provide string value in the request body. To do so click on the body tab and provide the string value as shown below.

POST Request using Postman

Once you provided the string value in the request body, click on the send button which will issue a post request to the web API. In the same way, you can test the PUT and DELETE Requests. In this article series, we are going to use the tool Fiddler and Postman to test the services. 


No comments:

Post a Comment

NET Core Code Security, Authorization/Authentication, and code architecture

Complex NET Core interview questions (Code Security, Authorization/Authentication, and code architecture)  _________________________________...