Get Header Value Function

The get_header_value function gets the value of a header. It uses the following format:

get_header_value(index)

where:

  • index is a numeric value that identifies the header index. This index starts with 0 as the first value. To access the first header, you use an index value of 0. To access the second header, you use an index value of 1, and so forth.

For example, the following code gets the value of the first header:

var header_val = req.get_headers().get_header_value(0);.