Postman Headers and Params

Every API request carries two types of extra information beyond the URL itself: headers and parameters. This topic explains what they are, when to use each one, and how to add them in Postman.

The Envelope Analogy

Think of an API request as a letter in an envelope.

  • The URL is the delivery address on the envelope
  • Headers are the extra notes written on the outside of the envelope — things like "fragile," "return address," or "express delivery"
  • Query parameters are instructions in the delivery address itself — like a specific apartment number or a floor
  • The body is the actual letter inside the envelope

What Are Query Parameters

Query parameters appear at the end of a URL after a question mark ?. They filter, sort, or paginate the data you get back.

Base URL:         https://api.example.com/products
With parameters:  https://api.example.com/products?category=shoes&sort=price&limit=10

In this example:

  • category=shoes — filters results to only show shoes
  • sort=price — sorts results by price
  • limit=10 — returns only 10 results

Each parameter is separated by an ampersand &.

Add Query Parameters in Postman

You can type parameters directly into the URL bar, or use the Params tab for a cleaner approach.

  1. Open a new GET request
  2. Enter this URL: https://jsonplaceholder.typicode.com/posts
  3. Click the Params tab below the URL bar
  4. Add a new row: Key = userId, Value = 1

Postman automatically builds this URL in the URL bar:

https://jsonplaceholder.typicode.com/posts?userId=1

Click Send. The server returns only the posts made by user 1, instead of all posts.

Disable a Parameter Without Deleting It

Click the checkbox next to any parameter row in the Params tab to turn it off temporarily. This lets you test the request with and without that parameter quickly.

What Are Path Parameters

Path parameters appear inside the URL path itself, not after a question mark. They usually identify a specific resource by its ID.

https://api.example.com/users/{userId}/orders/{orderId}

The curly braces show where values go. When you send the request, the actual values replace the placeholders:

https://api.example.com/users/42/orders/17

In Postman, you define path variables in the URL with a colon prefix:

https://jsonplaceholder.typicode.com/posts/:postId

Then fill in the value in the Path Variables section that appears inside the Params tab.

What Are Headers

Headers are key-value pairs that travel with your request to give the server extra context about who you are, what format you want, or what kind of data you are sending.

Header NameWhat It DoesExample Value
Content-TypeTells the server the format of the body you are sendingapplication/json
AcceptTells the server the format you want in the responseapplication/json
AuthorizationCarries your credentials or API keyBearer eyJhbGci...
User-AgentIdentifies the client making the requestPostmanRuntime/7.36.0
Cache-ControlControls caching behaviorno-cache

Add Headers in Postman

  1. Open a request (GET or POST)
  2. Click the Headers tab below the URL bar
  3. Click in the Key column and type a header name, such as Content-Type
  4. Click in the Value column and type the value, such as application/json

Postman already adds some headers automatically when you set up a JSON body. You can see these in the Headers tab as greyed-out auto-generated entries.

Hidden Auto Headers

Postman manages several headers behind the scenes. Click the hidden badge count next to the Headers tab to see these auto-generated headers. They include things like Host, User-Agent, and Accept-Encoding.

When You Must Set Headers Manually

  • When the API requires Content-Type: application/json for POST requests
  • When you need to pass an API key in a header like x-api-key
  • When the server only returns a specific format and needs an Accept header to pick it

Response Headers

After you send a request, the server sends back its own set of headers with the response. Click the Headers tab in the response panel to see them. Common response headers include:

  • Content-Type — the format of the response body
  • Content-Length — the size of the response in bytes
  • Date — the time the response was sent

Summary

Query parameters filter and shape what the server returns, and they appear after a question mark in the URL. Path parameters point to a specific resource inside the URL path. Headers send contextual metadata about the request itself. The Params tab and Headers tab in Postman make it easy to add and manage these values without touching the URL manually.

Leave a Comment

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