INTEGRAL DSL Reference Guide
Jump directly to:
::my.app.GetPostVar(string, default_val = "")
::my.app.GetPostVar_AsBase64(string, default_val = "")
These functions return the value of the requested POST variable. GetPostVar returns the value as a plain string, while GetPostVar_AsBase64 returns the value as a Base64 encoded string. The two functions are identical otherwise.
Parameters
string
A string containing the name of the POST variable to return.
default_val
A string containing the default value of the POST variable.
Return Value
Both functions return a string containing the value of the requested variable, if that variable is found in the POST payload. If the variable is not found in the POST payload, the functions return default_val.
Example 1
local first_name = ::my.app.GetPostVar("fname");
Example 2
local month_name = ::my.app.GetPostVar("month_name", "January");
Example 3
local month_number = ::my.app.GetPostVar("month_num", 1).tointeger();
Example 4
local format_id = ::my.app.GetPostVar("format", DX_FORMAT_PDF).tointeger();
Example 5
local image_as_base64 = ::my.app.GetPostVar_AsBase64("image_file");