Unable to access header value which name contains dash(-)

Hi,
I built a custom webhook template connector, and for the API key, the system calling the webhook sends a header with the name “x-api-key”.

When I try to access the value using an expression request.headers["x-api-key"], it does not work. I also tried request.headers["\"x-api-key\""] but without any success.

What is the proper way to access header values whose names contain a dash?

Hey @ivicac , can do so using the get value() function:

get value(request.headers, "x-api-key")

Here is a working example

1 Like

Hi @sbuettner, it is working.
thx

1 Like