Loading

ASP.NET Web API

How to use POSTMAN to test Web API Services?. The Complete ASP.NET Web API Developer Course 2023 [Videos].

In this article, I am going to discuss how to use POSTMAN to test Web API Services with examples. We are going to work with the same example that we created in our Creating first web API application article, so please read that article before proceeding to this article. As part of this article, we are going to discuss the following pointers.

  1. What is Postman?
  2. How to download and Install Postman?
  3. How to test Web API Services using Postman?
  4. Understanding the Request and Response of Postman.
  5. How to use Postman to test Get, Post, Put and Delete Request?
What is POSTMAN?

The Postman is the most popular and the most powerful HTTP client for testing the restful web services. Postman makes it easy to test the Restful Web APIs, as well as it develops and documents Restful APIs by allowing the users to quickly put together both simple and complex HTTP requests. The Postman is available as both a Google Chrome in-browser app and Google Chrome Packaged App.

The packaged app version of Postman provides many advanced features that include OAuth 2.0 support and bulk uploading/importing that are not available with the Google Chrome in-browser app version. The in-browser version includes a few features, such as session cookies support, that are not yet available in the packaged app version.

Lets 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. 

See All

Comments (310 Comments)

Submit Your Comment

See All Posts

Related Posts

ASP.NET Web API / Blog

What is ASP.NET Web API Application?

In this ASP.NET Web API Tutorials series, I covered all the features of ASP.NET Web API. You will learn from basic to advance level features of ASP.NET Web API. The term API stands for “Application Programming Interface” and ASP.NET Web API is a framework provided by Microsoft which makes it easy to build Web APIs, i.e. it is used to develop HTTP-based web services on the top of .NET Framework.
3-Feb-2022 /34 /310

ASP.NET Web API / Blog

How to creat ASP.NET Web API Application using Visual Studio?

In this article, I am going to discuss the step-by-step procedure for Creating ASP.NET Web API Application. Please read our previous article before proceeding to this article where we gave an overview of the ASP.NET Web API framework. As part of this article, we ate going to discuss the following pointers.
3-Feb-2022 /34 /310

ASP.NET Web API / Blog

How to add Swagger in Web API Application?

In this article, I am going to discuss how to add Swagger in Web API Application to document and test restful Web API services. Please read our previous article where we discussed How to Create an ASP.NET Web API Application step by step before proceeding to this article as we are going to work with the same example. As part of this article, we are going to discuss the following pointers.
3-Feb-2022 /34 /310