Menu Expand Search
CS4530, Summer 2025

Making API Requests With Postman

Tutorial: Guide to API Requests and Installing Postman

Contents

Introduction to API Requests and Postman

APIs (Application Programming Interfaces) are essential tools that allow different software applications to communicate with each other. As developers, it’s crucial to understand how to interact with APIs, which involves making API requests. API requests are structured interactions where one software sends a request to retrieve or send data to another.

Postman is a popular API testing tool that allows developers to build, test, and modify APIs quickly and easily. It provides an interface to interact with APIs and simplifies API development. Postman supports making requests like GET, POST, PUT, DELETE, and more.

With this guide, you can:

Types of API Requests:

There’s a whole vocabulary of HTTP requests, but GET and POST are the two most important:

Each of these request types serves a specific purpose in API interactions, and Postman allows you to easily switch between them to test and build your APIs.

Breakdown of an API Request

Each API request has key components:

1. URL

For this URL -> https://localhost:8000/api/thread/list

The URL defines the location of the API you’re interacting with:

2. Method

Defines the action type:

3. Parameters (GET) vs. Body (POST)

4. Headers

Headers provide additional information about the request or the client making it. They help the server understand the request. Some common headers include:

5. Response

After the server processes the request, it sends back a response. The response typically includes:

Mozilla documentation for reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

Steps to Install Postman

Step 1: Download Postman

  1. Open your web browser and navigate to the official Postman website: https://www.postman.com/downloads/.
  2. Select the version that is compatible with your operating system (Windows/macOS). If you’re using a Mac, be sure to download the version that corresponds to your system’s chip (Intel or Apple).
  3. Click the “Download” button.

Step 2: Install Postman

For Windows:

  1. Once the download is complete, find the setup file in your downloads folder (typically named Postman-win64-setup.exe).
  2. Double-click the file to start the installation.
  3. Follow the on-screen instructions to complete the installation. Postman will install automatically and open once the process is finished.

For macOS:

  1. Open the downloaded .dmg file.
  2. Drag the Postman app icon into the “Applications” folder.
  3. Once copied, go to your Applications folder and double-click the Postman icon to launch the app.

Once Postman is installed:

  1. Open the Postman application.
  2. You will be prompted to sign in or create a Postman account.

Using Postman: Basic Steps

Step 0: Ensure your backend is running

Step 1: Launch Postman

After installation, launch Postman. You’ll see a workspace where you can start creating requests.

Step 2: Make Your First API Request

  1. Click on the “New” button at the top-left and select HTTP.

    Postman1

  2. In the request window, choose the type of request method (GET, POST, PUT, DELETE) from the dropdown menu (default is GET).

  3. Enter the URL of the API you want to test in the input field. (If you’re running the course project, try http://localhost:8000/api/thread/abadcafeabadcafeabadcafe/comment). Ensure that the ID is valid and belongs to one of the questions in the database.

    Postman2

  4. To send a POST request you need to enter the URL (e.g., http://localhost:8000/question/addQuestion) and include the Body as well.

    • Go to the Body tab.
    • Select raw.
    • Choose JSON as the format.
    • Enter the JSON data in this format:
    {
      "auth": {
        "username": "user3",
        "password": "pwd3"
      },
      "payload": "I would like to play Nim"
    }

    Postman3

  5. Click the Send button.

Step 3: View the Response

Saving API Requests and Using History

One of Postman’s key features is the ability to save API requests for future use. This can save you time when testing or working on multiple endpoints. Additionally, Postman keeps track of your request history, allowing you to quickly revisit previous requests without re-entering all the details.

To learn more about using Postman’s history, visit: Postman History.

Organizing Requests into Collections

Postman also allows you to save and organize requests into collections. A collection is essentially a folder where you can store multiple requests, making it easier to manage large projects and share API workflows with your team.

For more information on creating and using collections, refer to the Postman documentation: Postman Collections.

These features enhance your ability to efficiently manage, organize, and track your API development process within Postman.

In addition to using the Postman desktop app, you can also integrate Postman with Visual Studio Code through the Postman extension. This extension allows you to send API requests directly from your code editor.

You can find the extension and its documentation here: Postman VS Code Extension.