HEADERS Section

The HEADERS section is used when a specific HTTP Header is changed based on user requests or responses. Headers items can be configured in the SERVER or DESTINATION sections.

Configuration Items

The following is the configuration format of the HEADERS section.

#"headers": {
    #"headers_list": [
        {
            "name": string,
            "action": string,
            "field_name": string,
            #"field_value": string,
            #"reg_exp": string,
            #"status_code": integer     # 0
        }
    ]
}

Refer to Types of Setting Values and Configuration Methods for more information on symbols and details of the HEADERS section configuration items.

headers_list

The following is a list of HEADERS settings.

Item Description

Data Type

Array (object)

headers_list/name (Required)

The name of the HEADERS setting. This 'name' must be set when using the functionality of the HEADERS section in other sections.

Item Description

Data Type

String

Range

Up to 255 characters

headers_list/action (Required)

Configures the action for handling HTTP headers.

Item Description

Data Type

String

Range

"AddRequest" | "AddResponse" | "AddIfAbsentRequest" | "AddIfAbsentResponse" | "AppendResponse" | "EchoResponse" | "SetResponse" | "UnsetResponse"

The following describes each action type.

Action Description

AddRequest

Adds a specified HTTP header in the request. Caution is advised as duplicates may occur if the specified header already exists in the request.

AddResponse

Adds a specified HTTP header in the response. Caution is advised as duplicates may occur if the specified header already exists in the response.

AddIfAbsentRequest

Adds a specified HTTP header when the request contains no HTTP headers.

AddIfAbsentResponse

Adds a specified HTTP header when the response contains no HTTP headers.

AppendResponse

Appends a specified FieldValue at the end of an existing header value. If there is no existing header, no action occurs.

EchoResponse

Adds the same header and value to the response as the request, if the request contains a specified header. This action has no FieldValue.

SetResponse

Adds a specified HTTP header when the response contains no HTTP headers. If the header already exists, the header value is replaced by the specified FieldValue.

UnsetResponse

Deletes a specified header if it already exists in the response. This action has no FieldValue.

Certain Action types have required field_value.

headers_list/field_name (Required)

Specifies the name of the HTTP header.

Item Description

Data Type

String

Range

Up to 255 characters

headers_list/field_value

Specifies the value of the HTTP header.

Item Description

Data Type

String

Range

Up to 255 characters

headers_list/reg_exp

Set to control headers when the HTTP request URL matches a Regular expression pattern.

Item Description

Data Type

String

Range

Up to 511 characters

headers_list/status_code

Set to control headers for a specific HTTP status code.

Item Description

Data Type

Integer

Range

0 ~ 599

Default Value

0

Example

The following is an example of configuring the HEADERS section:

{
    "headers": {
    "headers_list": [
      {
        "name": "header1",
        "action": "AppendResponse",
        "field_name": "Test_Header",
        "field_value": "test"
      }
    ]
  }
}