Beginner's Guide: Basic Usage of Postman

Postman is a go-to tool for API testing and can significantly enhance the efficiency of implementing an API strategy. This introduction aims to guide you through the basics of using Postman, ensuring that even those who have never used it before can effectively harness its capabilities.

Postman is a staple tool for API testing and greatly enhances efficiency when implementing an API strategy. This guide introduces the basic use of Postman, allowing even first-time users to get the hang of it.

What is Postman?

Postman is a popular tool for API (Application Programming Interface) development and testing. It allows developers to create and send HTTP requests to API endpoints for testing purposes, and to review request and response data. Postman provides a feature-rich interface for creating and editing requests, managing headers, setting parameters, and checking responses.

postman.png

Downloading and Installing Postman

Before testing APIs with Postman, you need to download and install the desktop app or use the web app. Postman's web app works on Windows, macOS, and Linux. For detailed installation instructions, refer to the following guide:

Postman Download & Installation (Windows, Mac, Linux)
In this article, I’ll introduce you to the most detailed step-by-step guide for downloading and installing Postman.

Differences between Free and Paid Versions of Postman

The Free plan of Postman comes with several limitations compared to the paid plans. It's crucial to understand these differences before starting to use Postman. Check out the detailed explanation below:

The Limitations of Postman’s Free Plan: Differences Between Free and Paid Versions
This article aims to fully explain the restrictions of Postman’s Free plan and highlight the differences between the free and paid versions.

Complete Guide on Using Postman

Once you have Postman installed on your computer or have access to the web app, you can refer to the following guide to effectively use Postman.

Testing REST APIs

Postman is widely used for testing RESTful APIs. It allows for both single endpoint testing and batch testing of multiple API endpoints. For more details, see:

User Guide: How to Test an API in Postman
Postman is one of the most renowned API testing tools out there. Many users primarily employ Postman to test RESTful APIs. In this article, we’ll introduce how to conduct API testing using this tool.

API Performance Testing

API performance testing evaluates how an API behaves under various load conditions. Postman supports performance testing for APIs. To learn how to perform these tests with Postman, refer to:

User Guide: How to Perform API Performance Testing in Postman
API performance testing is a process to evaluate how an API performs under different load conditions. Postman is one of the most well-known tools that supports API performance testing. This article will introduce a simple method for conducting API performance testing using Postman.

Sending HTTP Requests

HTTP is the most widely used protocol in APIs. Sending HTTP requests and retrieving responses is crucial in API testing. Postman is well-equipped for sending HTTP/HTTPS requests with its intuitive UI.

User Guide: How to Send HTTP/HTTPS Requests using Postman
How can you send HTTP/HTTPS requests? Here’s how to send them using the popular tool Postman. Additionally, since Postman doesn’t support Japanese, I’ll also introduce how to send requests using EchoAPI, which has a Japanese-friendly UI and is easier to use than Postman.
Sending HTTP Requests.png

Implementing POST Requests in Postman

POST is a widely used HTTP method for adding resources to a server.

Implementing POST Requests in Postman.png

With Postman, you can send POST requests with JSON, files, XML, and more from the client side to the server easily.

User Guide: How to Send a POST Request using Postman
When testing APIs, the POST method is one of the most commonly used HTTP methods. By sending POST requests, you can check if data can be written to an API endpoint. In this article, we’ll introduce you to how to easily send a POST request using Postman, a popular tool for API testing.

Testing SOAP APIs

SOAP APIs are commonly used for integrations between enterprise systems, especially in large companies. Postman can also be used to test SOAP APIs.

User Guide: How to Send SOAP API Requests Using Postman
SOAP APIs are widely used, especially by large enterprises, for integration between enterprise systems. But how can you send requests and verify responses in a SOAP API? In this guide, we’ll explore how to send SOAP API requests using the popular API testing tool, Postman.

To do this in Postman, set the request method to POST and adjust the request Headers by changing the Content-Type to "text/xml". Additionally, set the SOAPAction according to the HTTP method being used.

  • Uncheck the "Content-Type: application/xml" option.
  • Create a new Content-Type field and set its value to "text/xml".
  • Add a SOAPAction field and set its value to "#POST".
Sending SOAP API Requests with Postman.png

Creating Mock Servers with Postman

A mock server is a virtual server environment that mimics an actual server. By using a mock server, you can test APIs even when the actual API server is not yet completed. It is often necessary to create a mock server during API testing due to business requirements.

User Guide: How to Create a Mock Server with Postman
When testing APIs, there’s often a need to create a mock server due to business requirements. So, how do you create a mock server using Postman? In this article, I’ll show you how to create a mock server using Postman.

Postman, a widely used tool for API testing, includes a built-in mock server feature. Postman's mock server can simulate the behavior of a real server, significantly streamlining the testing process.

Creating Mock Servers with Postman.png

Using Environment Variables in Postman

Postman environment variables allow you to set dynamic values for request URLs, headers, body data, etc. This can significantly enhance testing efficiency.

Postman's environment variables are variables associated with an environment in Postman, used to represent configuration values and data during API development and testing. By using these variables, you can set dynamic values in various parts of your requests, such as the request URL, headers, and body data.

User Guide: How to Use Environment Variables in Postman
In this article, I will provide a detailed introduction to Postman environment variables and completely explain how to use them.
Using Environment Variables in Postman.png

This makes it easy to switch and reuse API endpoints, parameters, authentication information, and more.

Implementing OAuth 2.0 in Postman

OAuth 2.0 allows safe resource access without requiring users to share passwords.

Postman facilitates easy implementation of OAuth 2.0 through its Authorization tab.

Guide: Implementing OAuth 2.0 in Postman.png

Importing cURL into Postman

CURL is an open-source library and tool for performing HTTP communication from the command line. Alongside Postman, CURL is also widely used for sending API requests. This is why it's often necessary to use both CURL and Postman to send requests and test APIs.

How to Import cURL Requests in Postman
Postman is a commonly used tool for API testing. In addition to Postman, it is also common to use CURL to send API requests. Therefore, it’s quite common to test APIs by sending requests using both CURL and Postman. This article will explain how to import and send CURL requests in Postman.

To facilitate this, Postman provides a feature that allows for easy importing of data from cURL.

Importing cURL into Postman.png

Exporting Postman Collections

A Postman Collection in Postman, the API development tool, serves as a file format used for grouping and managing related API requests. It includes all necessary information for testing APIs, such as requests to API endpoints, request parameters, headers, body data, and authentication details. Collections are used to organize multiple API requests for batch execution, create testing scenarios, and document APIs.

How to Import and Export Postman Collections Data
This article will explain how to export and import collections in Postman. By switching to the more intuitive and user-friendly EchoAPI, you can eliminate the limitations of Postman collections and further enhance your productivity.

Whenever you need to share Postman collection information or switch to other applications, it is essential to export and import Postman Collections.

Exporting and Importing Postman Collections.png

Using Newman

Newman is a tool developed with Node.js that can execute collections and environments created in Postman, which is a GUI-based application used for API testing and documentation. Newman provides reporting features and can output test results in JSON or HTML format.

Usage Guide: How to Use Postman Newman
To significantly improve the efficiency of API testing, it’s often necessary to use Newman, the command-line tool for Postman. This article provides a comprehensive guide on how to use Newman.

By combining Postman and Newman, you can achieve both the convenience of a GUI and the flexibility of scripting, making it an ideal tool for API test automation.

Solution: Resolving Issues with Using Postman

When you're developing or testing APIs, Postman is undoubtedly a highly convenient tool. However, it does have some limitations that users often run into. Below, I'll introduce some common issues users face with Postman, and also propose some solutions.

Issue: Postman Lacks HTTP/2 Support

Since 2017, many users have expressed the desire for Postman to support the HTTP/2 protocol. But even after seven years, Postman still hasn't added HTTP/2 support.

Understanding HTTP/2: What is HTTP/2 & How to Test HTTP/2 APIs?
HTTP/1.1 has delivered over a decade of reliable performance, but HTTP/2 represents the future of web communication.

Currently, Postman does not support HTTP/2. So when testing APIs that use HTTP/2, an error message saying "Could not get response" appears, causing the test to fail.

Importing cURL into Postman.png

To test an API using the HTTP/2 protocol, Postman isn't suitable, so you need to use an API management tool that supports HTTP/2, like EchoAPI.

Issue with Collection Runner Limitations in Postman

Starting February 15, 2023, Postman implemented the following limitations for free-tier users. Existing customers with paid plans will face these same restrictions upon renewal of their plans after March 15, 2023 (excluding enterprise users).

Collection Runner Limitations in Postman:

Users on the Free and Basic plans can run collections up to 25 times per month. Those on the Professional plan can run collections up to 250 times per month. When you reach your limit in Postman, you’ll encounter an error that says, "You have exhausted all the runs. To keep running collections, create an account."

If you've hit the numerical limit for collection runners and want to run more collections, you should switch to EchoAPI, an API testing tool that doesn't have these restrictions. Unlike Postman, EchoAPI allows developers to create and run collections as they wish, without any limitations.

Why Choose EchoAPI?

EchoAPI EchoAPI is an ultra-lightweight collaboration tool for API development that supports Scratch Pad. It's a perfect alternative to Postman, offering features like API design, debugging, automated testing, and load testing. Plus, it comes with plugins for IntelliJ IDEA, VS Code, and a Chrome request capture extension, all without the need to log in.

Advantage:

  • No login required: Just install and start using it.
  • Supports Scratch Pad: Makes jotting down quick notes and ideas super easy.
  • Ultra-lightweight: It’s incredibly fast and doesn’t bloat your system.
  • 100% compatible with Postman script syntax: You can switch over without having to relearn anything.

EchoAPI offers seamless integration with IDEs and enhances API development and testing without the limitations sometimes encountered with Postman.

For more about EchoAPI, you can explore its features such as API design, debugging, automated testing, and load testing. With plugin for IntelliJ IDEA, extension for VS Code, and Chrome, EchoAPI makes API management a breeze without requiring login credentials.

EchoAPI tools.jpg

Installing EchoAPI for VS Code

Installing EchoAPI for VS Code

Getting started with EchoAPI is a breeze. Just navigate to the VS Code Extensions Marketplace, search for EchoAPI, and hit install. No additional tools or sign-ins are necessary—everything operates straight from your VS Code sidebar.

Creating New Requests

Creating New Requests with EchoAPI

To create a new request, start by opening the EchoAPI tab where you’ll see options for recent activities, collections, and environments. It’s pretty intuitive if you’ve used Postman before. Right-click on the collection list to create a New Collection, name it, and then right-click on the collection name to add a new request.

Running a collection

Just pick the folder you want to run, right-click, and hit "Run All." That’s it!

Running a collection with EchoAPI

Variables and Environments

Variables and Environments EchoAPI

Just like in Postman, you can use variables and manage environments in EchoAPI. EchoAPI is 100% compatible with Postman script syntax. To activate a specific environment for your tests, just set it as active (indicated by a star next to the environment name). Importing and exporting environments is compatible with Postman 2.1.0 format and .env files.

System Variables

System Variables EchoAPI

EchoAPI also has a set of system variables that streamline generating unique data. Prepend $ before the variable name to use them:

  • {{$guid}} - random UUID number
  • {{$email}} - random email string

Script-less Testing

Script-less Testing With EchoAPI

Testing in EchoAPI is straightforward and script-less. Choose a parameter from the dropdown menu, set your condition and value, and you’re done! There are plenty of parameters and conditions to choose from, like ResponseCode, ResponseBody, or Content-Type. You can even set values from API responses to environment variables or verify specific JSON path values.

Authentication

EchoAPI Authentication

EchoAPI supports various authorization types, including None, Inherit, Basic Auth, Bearer, and OAuth 1.0. This is super useful for testing secured APIs that require credentials or tokens.

Conclusion

This article explains the basics of using Postman, an API testing tool.

First, it covers an overview of Postman and how to install it. Next, it introduces specific usage methods for Postman, including testing REST APIs, sending HTTP requests, implementing POST requests, testing SOAP APIs, and testing WebSocket APIs. Additionally, it discusses some of Postman’s handy features, such as creating mock servers, using environment variables, and exporting collections.

And, it highlights some challenges with Postman, such as its lack of support for HTTP/2 and limitations of the collection runner. To address these issues, tools like EchoAPI can be utilized.

EchoAPI for VS Code now and always will be free for personal use. We're not going to pull a "Thunder Client" move where everything suddenly becomes paid, rendering the free version useless. You might be wondering, "How do you keep the team funded?" We're committed to ensuring that all the features you currently enjoy will always be free to use. In the future, we plan to introduce some premium features to cover the team’s costs while keeping the core functions free for individual developers.