INTEGRAL DSL Reference Guide
Jump directly to:
::my.app.GetOtherVar(string, default_val = "")
This function returns the value of the requested system-generated string variable.
Parameters
string
A string containing the name of the system-generated string variable to return. The following strings are currently supported:
- host — Hostname associated with the requested web page.
- cookie — Value of the INTERGAL authentication cookie.
- url — URL of the requested web page.
- rt — Request type (0 for GET, 1 for POST).
- bt — Boundary type (0 for standard GET and POST form submissions and 1 for POST submissions in “multipart/form-data
” format).
- boundary — Content boundary
extracted from the POST payload, if the POST submission is in “multipart/form-data” format.
- client_ip_addr4 — Client's IPv4 address
- client_ip_addr6 — Client's IPv6 address
- protocol — Client's protocol (HTTP or HTTPS)
See the examples below showing some possible values associated with the above variables.
default_val
A string containing the default value of the system-generated string variable.
Return Value
The function returns a string containing the value of the requested system-generated string variable, if that variable exists. If the variable does not exist, the function returns default_val.
Example 1
::my.app.Print(::my.app.GetOtherVar("host"));
Result:
testing.example.com
Example 2
::my.app.Print(::my.app.GetOtherVar("cookie"));
Result:
auth_0_2-18295-249_dt2b40ffffffff9110df4f4c37
Example 3
::my.app.Print(::my.app.GetOtherVar("url", "default.i"));
Result:
form_get.i
Example 4
::my.app.Print(::my.app.GetOtherVar("bt", 0));
Result:
1
Example 5
::my.app.Print(::my.app.GetOtherVar("boundary"));
Result:
---------------------------1119586077631481125439084401
Example 6
::my.app.Print(::my.app.GetOtherVar("client_ip_addr4"));
Result:
127.0.0.1