Get HTTP header values

I/O and network Pure
Get HTTP header values
Headers(HTTP headers)
Values
Name

Description

Pure function returning every value of the named header as a string array, in insertion order. Returns an empty array if the header is not set. Header names are matched case-insensitively.

When to use

Use Get HTTP header values when a header can carry several values — Set-Cookie, Accept, Via, or any custom multi-valued header. Wire the resulting array into a For each loop to iterate, into Array length to count, or into Array at to pluck a specific value.

Pins

Input pins

Pin Type Default Notes
Headers HTTP headers The headers collection to read from. Wire from a Receive HTTP `headers` output or from a Break node on an HTTP response.
Name string The header name to look up. Matched case-insensitively.

Output pins

Pin Type Notes
Values string[] All values for the header, in insertion order. Empty array when the header is absent.

Example

Iterate every Set-Cookie value from an HTTP response. Wire the Response output of HTTP request through a Break node and into the Headers input of Get HTTP header values. Set Name to Set-Cookie, then wire the Values output into the Array input of a For each loop to process one cookie at a time.

See also