Access Response Headers with Postman Tests

Hi,

Is there a way to access the Response Headers with a Postman test? I am making a call to check the Status of a website, but would also like to console log the Server and Content-Type values that are returned. thanks for any insights

1 Like

@pfrancis-vendini Welcome to the Postman Community and yes, there’s definitely a way to access the response headers within the test script.

You can use the following in your test script:

let responseHeaders = pm.response.headers.all();

You can read the docs around how to use the pm.response api and all the different functions that it offers.

Also, HeaderList docs - http://www.postmanlabs.com/postman-collection/HeaderList.html

3 Likes

slvcan, Thanks very much! Cheers! :grinning:

1 Like