Postman

Postman-astronaut

Postman is the most popular tool for testing API today.

Postman provides a convenient graphical interface for creating HTTP requests and viewing HTTP responses, making manual testing significantly easier. Postman also offers automation capabilities.

Why use Postman

Previously, we tested APIs in two ways:

  • via GUI forms created by frontend developers
  • using the curl command-line utility

Once you learn how to use Postman, you can rely on it as a more convenient alternative to curl when an application does not provide a graphical interface.


curl
tester-today@pc ~ % curl \
https://www.tester-today.com/endpoint \
-H "Content-Type: application/json" \
-X POST \
-d '{"name":"Mia"}'

A request executed with the curl utility in the console.

Postman
Postman request with json body

An equivalent request made using Postman’s graphical interface.

Installing Postman

You can download Postman from the official website.

Postman is available as:

  • a desktop application
  • a web service

There is also the Postman Interceptor extension for Google Chrome, which works together with the desktop version and allows you to intercept browser requests and modify them if needed.

How to send an HTTP request

To create a request in Postman, you need to select:

  1. New
  2. HTTP Request
  1. Choose the HTTP method from the dropdown
  2. Enter the URL of the service you are calling
Postman create new http request
Postman http request method and url
  1. Specify the required headers
  2. For example, Content-Type: application/json
  1. Select the request body, if needed
  2. Choose the body format
  3. Enter the request body
Postman http request headers
Postman http request with json body

Click the Now press the actual Send button in Postman

Task

Send your first HTTP request using Postman!

Build your request based on the API specification:

  • HTTP method POST (3)
  • URL address of the requested resource: https://tester-today.com/postman/my-first-rq (4)
  • Header with the content type application/json (5-6)
  • Request body in the format of JSON (7-8)

Request body requirements (9):

Field Type Required Constraints
name string + from 3 to 20 characters
quantity number + from 1 to 10

Remember that numeric values in JSON are written without quotation marks.

In this task we are not looking for a bug — just getting familiar with a new tool

Sidebar arrow