HTTP:respond(t)
Allows you to return a customized page and send out an HTTP response directly from FortiADC.
Syntax
HTTP:respond(t);
Arguments
| Name | Description |
|---|---|
|
t |
A table which will give the response code and content. |
Events
Applicable in the following events:
-
BEFORE_AUTH
-
HTTP_DATA_REQUEST
-
HTTP_REQUEST
-
HTTP_RESPONSE supported since V7.2.4 and V7.4.1.
-
WAF_REQUEST_ATTACK_DETECTED
-
WAF_REQUEST_BEFORE_SCAN
Example
when HTTP_REQUEST {
tt={}
tt["code"] = 200;
tt["content"] = "HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Type: text/plain\r\n\r\nXXXXX Test Page XXXXXXX";
status = HTTP:respond(tt);
debug("HTTP_respond() status: %s\n", status);
}
Supported Version
FortiADC version 5.2.x and later.