How to see which headers a request inherits in API Spector

Roy de Kleijn Roy de Kleijn · · 2 min read
How to see which headers a request inherits in API Spector

You can set headers once on a collection or a folder, and every request underneath sends them. That keeps shared values like an API key or an Accept header in one place. The catch used to be visibility: to know what a request actually sends, you had to open each parent level and read its headers. Now the Headers tab shows them for you.

Set a header on a collection or folder

Open the collection settings (or a folder's settings) and go to the Headers tab. Add a header there, for example Accept: application/json or X-Api-Version: 2. Every request inside that collection or folder will send it.

See what a request inherits

Open any request and go to its Headers tab. Below your own headers there is an Inherited headers list. Each row shows the header name, its value, and a badge naming the level it is defined on, either the collection or a specific folder.

The list is ordered the way the headers are applied when the request runs: the collection first, then the folders from the top of the path down to the request. That is exactly what goes on the wire, so there is no guessing and no need to open each parent.

Send your own value too

The inherited list is read-only, because those headers belong to the parent. If you want this request to also send its own value for a header, add it in the table above with the same name. Both are part of the request.

Why it helps

For a collection shared with a team, a reader can open one request and see every header it sends and where each one is set, without hopping between the request, its folders, and the collection. Define shared headers once, high up, and let the Headers tab make the result obvious everywhere below.

Try it in API Spector

Free and open source. No account needed to use the app.

Keep reading