How to set header request in Postman?
Last Updated :
30 Jul, 2024
Postman is a powerful API development tool that offers a feature known as environment variables. These variables are used for efficient testing and development of APIs by allowing users to manage dynamic values across requests easily. In this article, we will learn How you can set header requests in Postman.
Prerequisites
Some APIs require you to send particular headers along with requests, typically to provide more metadata about the operation you are performing. These headers are in the form of key-value pair values.
Automatic Headers:
Postman will automatically add certain headers to your requests based on your request selections and settings. Select hidden at the top of the headers tab for information about what Postman will send with your request as shown below

Some other user-defined headers can be passed as a key-value pair. Follow below steps to add headers request
Steps to set header request in Postman?
Step 1: After downloading and installing the Postman, open the software. Add a new Collection and give it a name like "GFG".
Step 2: When you hover, on the name of your collection, 3 dots will appear. Click on those 3 dots, and then click on "Add new request"

Step 3: You need to select "GET/POST/PUT/DELETE etc" request from the dropdown down menu as per requirement and click on "Headers" Tab as shown below.
Example: In this example, we are selecting "GET"

Step 3: Now You can simply paste the API in the space provided and click on Send. Output will be shown in the body with the status code; 200 (OK)
API Used:
https://api.api-ninjas.com/v1/emoji?name=slightly smiling face
To call this API: we need to provide Headers as mentioned below
Headers:
x-api-key (required) - API Key associated with your account.
You can get API key associated with your account by creating an account on this website
https://api-ninjas.com/api/emoji
Output:
Similar Reads
How to create and send GET requests in Postman? Postman is an API(application programming interface) development tool which helps to build, test and modify APIs. It has the ability to make various types of HTTP requests(GET, POST, PUT, PATCH), saving environments for later use, converting the API to code for various languages(like JavaScript, Pyt
1 min read
How to create a new request in Postman? Postman is a development tool that is used for testing web APIs i.e. Application Programming Interfaces. It allows you to test the functionality of any application's APIs. Almost every developer uses Postman for testing purposes. We can create any type of HTTP request in it such as GET, POST, PUT, D
2 min read
How to create and send POST requests in Postman? Postman is an API(application programming interface) development tool which helps to build, test and modify APIs. It can make various types of HTTP requests(GET, POST, PUT, PATCH), saving environments for later use, and convert save the API to code for various languages(like JavaScript, and Python).
2 min read
How to execute post-request scripts in Postman? Postman is an API(application programming interface) development tool that helps to build, test and modify APIs. It can make various types of HTTP requests(GET, POST, PUT, PATCH), save environments for later use, and convert the API to code for various languages(like JavaScript, and Python). In this
2 min read
How to perform DELETE requests in Postman? Postman is an API(application programming interface) development tool which helps to build, test and modify APIs. It can make various types of HTTP requests(GET, POST, PUT, PATCH), save environments for later use, and convert the API to code for various languages(like JavaScript, and Python). In thi
2 min read