Postman has long been a favorite for testing Business Central APIs. With the launch of the Postman VS Code extension, the experience has been improved. In this guide, we’ll explore its installation, compare it to the web app, and highlight its key features. Dive in to maximize your API testing within VS Code.

  • Introduction
  • Postman Setup
  • Web App Vs Extension
  • Simple Test Request
  • Postman Console

Introduction


In a previous article, we discussed how to use the Postman web app to connect with Business Central APIs:

In May 2023 Postman released a VS Code extension in the Marketplace. Now, we can test APIs without leaving VS Code. Making it faster to work with the tool in a centralized way.


Find the info here:

Introducing the Postman VS Code Extension | Postman Blog

Postman Setup


First, look for Postman in the Extension Marketplace or in VS Code and install it:

Postman – Visual Studio Marketplace


You will see a new Postman icon added to the VS Code ribbon. To access, you will have to sign in or create an account first:


Web App Vs Extension


Once signed in, you will see the user interface. As you will notice, both applications are very similar. But let’s compare them and find similarities and differences.

You can find Collections, Environments, and History similar to what you see in the web app on the left pane. However, you can’t import new collections in VS Code.

On the left, is the Postman web app, and on the right VS Code. You can see as well your folders and list of requests.

We can’t export existing collections. As you can see, there are limited options for them compared to the web app. We only can:

  • Add Request
  • Add Folder
  • Rename
  • Duplicate

However, we can create new collections with no specific template.

If you click on “Add a request” it will create a GET HTTP blank request.

And, as you can see, looks very similar to the web app. With Authorization, Headers, Body, etc, the same sections as the web app.

If we have a look at the authorization section, it’s very similar.

And you have all the fields needed to authenticate.


Simple Test Request


If we run a simple request, you can see the result below.

You can see the code snippet. However, in VS Code the header is not visible here. At the top is the web app, and at the bottom VS Code.


Postman Console


If you go to the VS Code console, you will see a section called “POSTMAN CONSOLE” where you will have access to the console and to all the information of the request, including headers and body.


While the new Postman extension has some limitations, it definitely has everything you need to test Business Central APIs. Making it faster than using the web or desktop applications.

There is also an alternative way to create requests directly from VS Code, and that is by using the REST Client. Learn more in this article:


That´s all. Hope you find it helpful.

Postman Extension: Fastest Way To Test Business Central APIs

Post navigation


Leave a Reply

Your email address will not be published. Required fields are marked *