Fortinet white logo
Fortinet white logo

Script Reference Guide

HTTP:payload(set)

HTTP:payload(set)

Inserts the specified data at the specified location.

Syntax

HTTP:payload(t);

Arguments

Name Description

t

A table which specifies the parameters: offset, size, data to set.

Events

Applicable in the following events:

  • HTTP_DATA_REQUEST

  • HTTP_DATA_RESPONSE

Example

when HTTP_DATA_REQUEST {
t={};
t[“operation”]=”set” --replace the buffered content by new data
t[“offset”]=12;
t[“size”]=20;
t[“data”]= ”new data to insert”;
ret = HTTP:payload(t); --return value is boolean: false if fail, true if succeed
}

Note: The “offset” and “size” fields are optional. If the “offset” field is missing, zero is assumed. If the “size” field is missing, it will operate on the whole buffered data.

Supported Version

FortiADC version 4.8.x and later.

HTTP:payload(set)

HTTP:payload(set)

Inserts the specified data at the specified location.

Syntax

HTTP:payload(t);

Arguments

Name Description

t

A table which specifies the parameters: offset, size, data to set.

Events

Applicable in the following events:

  • HTTP_DATA_REQUEST

  • HTTP_DATA_RESPONSE

Example

when HTTP_DATA_REQUEST {
t={};
t[“operation”]=”set” --replace the buffered content by new data
t[“offset”]=12;
t[“size”]=20;
t[“data”]= ”new data to insert”;
ret = HTTP:payload(t); --return value is boolean: false if fail, true if succeed
}

Note: The “offset” and “size” fields are optional. If the “offset” field is missing, zero is assumed. If the “size” field is missing, it will operate on the whole buffered data.

Supported Version

FortiADC version 4.8.x and later.