How to send a request with Postman

Postman is a great tool for web development. You can send a request to any web API, look at the response details, and reuse the the request later (which saves lots of effort!). This is useful for testing your own web API, or for when you’re integrating with a third-party API and want to try out some requests before writing code.

There are several ways to add a new request in Postman. The simplest way is to click the plus (+) button.

Postman - Red arrow pointing to the plus (+) button with text "Click to create a new request"

This adds a new request tab. At a bare minimum, fill in the URL and set the HTTP method (ex: GET). Then click the Send button and look at the response.

Postman request - Shows the HTTP Method and URL set, clicking the Send button, and the response body and status code

Note: Be sure you’re looking at the Response section. Everything in Postman is resizable, so it’s easy to get a little lost sometimes and confuse the Response tabs (Body, Headers) with the Request tabs (Body, Headers) since they are so close together.

Besides setting the HTTP method and URL, you can also add query parameters, request headers, and add a request body. I’ll show examples of these below.

Add query parameters

To add query parameters, click on the Params tab and type in the query parameters as key/value pairs.

Postman request - Showing the Params tab and a key/value pair typed in

Notice that it automatically adds the correctly formatted query string (?id=1) to the URL for you. You can definitely type out the query string manually if you really want to, but I would suggest letting Postman do the work for you.

When you send the request, it sends exactly as shown above:

GET https://localhost:9000/movies?id=1Code language: plaintext (plaintext)

Add request headers

To add request headers, click on the Headers tab and type in the headers as key/value pairs:

Postman request - Showing the request Headers tab and a key/value pair typed in

It’ll send the request like this:

POST https://localhost:9000/movies/1
apiKey: 7db643fa-1250-4e7f-9ae2-e70c09a7a2eb

<other headers not shown for brevity>Code language: plaintext (plaintext)

Note: Postman adds several standard request headers, such as the User-Agent header. You can see these by toggling the “hidden” button (located next to the word “Headers”).

Add a request body

To show how to add a request body, I’ll show an example of sending a POST request with a JSON request body (a common scenario). Here are the steps:

  • Set the HTTP Method to POST.
  • Click the Body tab.
  • Select raw and change the dropdown to JSON.
  • Add JSON to the textbox.
Postman request - Showing the HTTP method set to POST, and the Body tab with the "raw" radio button selected and "JSON" selected in the dropdown. Shows JSON in the body textbox.

When you send a request body, Postman automatically adds the proper content headers for you. Here’s what the request looks like:

POST https://localhost:9000/movies
Content-Type: application/json
Content-Length: 72
    "id": 1,
    "title": "The Matrix",
    "yearReleased": 1999
}Code language: plaintext (plaintext)

Leave a Comment