0
0
PostmanHow-ToBeginner ยท 3 min read

How to Send Headers in Postman: Step-by-Step Guide

To send headers in Postman, open your request, go to the Headers tab, and add key-value pairs for each header you want to send. Postman includes these headers automatically when you send the request.
๐Ÿ“

Syntax

In Postman, headers are sent as key-value pairs under the Headers tab of your request. Each header has a Key (header name) and a Value (header content).

Example headers include Content-Type, Authorization, and Accept.

text
Key: Content-Type
Value: application/json

Key: Authorization
Value: Bearer your_token_here
๐Ÿ’ป

Example

This example shows how to send a JSON POST request with an Authorization header and Content-Type header in Postman.

http
POST https://api.example.com/data

Headers:
Content-Type: application/json
Authorization: Bearer abc123token

Body (raw JSON):
{
  "name": "John",
  "age": 30
}
Output
Status: 200 OK Response Body: { "success": true, "message": "Data received" }
โš ๏ธ

Common Pitfalls

  • Forgetting to add the Content-Type header when sending JSON causes the server to misinterpret the data.
  • Using incorrect header names or typos prevents the server from recognizing your headers.
  • Not including authorization headers when required leads to authentication errors.
  • Headers set in the Headers tab override any automatic headers Postman adds.
text
Wrong way:
Key: content-type
Value: application/json

Right way:
Key: Content-Type
Value: application/json
๐Ÿ“Š

Quick Reference

Header NamePurposeExample Value
Content-TypeTells server the data formatapplication/json
AuthorizationSends credentials or tokensBearer abc123token
AcceptTells server what response formats are acceptedapplication/json
User-AgentIdentifies the client softwarePostmanRuntime/7.29.0
โœ…

Key Takeaways

Add headers as key-value pairs in the Headers tab before sending your request.
Always use correct header names with proper capitalization.
Include Content-Type header when sending JSON or other data formats.
Authorization headers are required for protected APIs.
Headers in Postman override automatic headers if set manually.