Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.
Here’s an outline with best practices for making your inquiry.
My question:
What is the code to find the disabled request header? Seems like pm.request.headers.has(‘key’, ‘value’) returns TRUE if Header/key is disabled/unselected in Postman if it has a value field has some value.
You are correct, by default the pm.request.headers list will return all of the headers, regardless of whether they were enabled. Here is such an example:
If you just want to get the disabled headers, you could use a filter command to select just the headers which are disabled, and then check to see whether your desired header exists in this new list: