Fortinet white logo
Fortinet white logo

Script Reference Guide

HTTP:header_get_value(header_name)

HTTP:header_get_value(header_name)

Returns the value of the HTTP header named <header_name>.

Returns false if the HTTP header named <header_name> does not exist. The command operates on the value of the last head if there are multiple headers with the same name.

Syntax

HTTP:header_get_value(header_name);

Arguments

Name Description

Header_name

A string which specifies the header name.

Events

Applicable in the following events:

  • HTTP_REQUEST

  • HTTP_RESPONSE

Example

when HTTP_REQUEST {
host = HTTP:header_get_value("Host");
debug("host is %s\n", host);
}

Supported Version

FortiADC version 4.3.x and later.

HTTP:header_get_value(header_name)

HTTP:header_get_value(header_name)

Returns the value of the HTTP header named <header_name>.

Returns false if the HTTP header named <header_name> does not exist. The command operates on the value of the last head if there are multiple headers with the same name.

Syntax

HTTP:header_get_value(header_name);

Arguments

Name Description

Header_name

A string which specifies the header name.

Events

Applicable in the following events:

  • HTTP_REQUEST

  • HTTP_RESPONSE

Example

when HTTP_REQUEST {
host = HTTP:header_get_value("Host");
debug("host is %s\n", host);
}

Supported Version

FortiADC version 4.3.x and later.