Access Response Header Value in HTTP Module

How can I access a specific response header value (e.g. “Location”) when performing a POST request using the HTTP module?

Hi @Jorg_Ackermann ,
Great question!

When using the HTTP module you can access the response headers by using the Headers[] from the output of the call. This would retrieve you an array with items having all headers within the request.

Now if you want to extract some kind of specific header value which has a specific key, you can use the map() and get() function.

First use map() to create a new array from a mapping you make:

{{map(1.headers; "value"; "name"; "headerkey")}}

This mapping basically says: “retrieve all values, where the name is equal to headerkey” (I placed a header in there with a key called “headerkey”.

Using the map() function you will get a new array. If you want to get a text value instead, use the get() function to retrieve the first and only item:

{{get(map(1.headers; "value"; "name"; "headerkey"); 1)}}


Success! Hope this helps you.
Let me know if you have any more questions.

2 Likes