When a request header is deactivated (unchecked) in the Postman GUI, it is still sent with the outgoing request. Deactivated headers should not be included in the request at all.
Steps to Reproduce
-
Add any header to your request in Postman.
-
Deactivate (uncheck) the header in the Headers tab.
-
Add the following test script to your request:
JavaScript
pm.test("List all sent request headers", function () { let headers = pm.request.headers.toJSON(); headers.forEach(function(header) { console.log(header.key + ": " + header.value); }); });
-
Send the request.
-
Open the Postman Console and observe that the deactivated header still appears in the list of sent headers.
Expected Behavior
Deactivated headers should not be sent with the request or appear in the list of actual request headers.