Functions
A function performs an action, and returns a value. Functions are used to provide useful capabilities to TrafficScript.
TrafficScript contains a large number of functions to manipulate data or manage the current request. For ease of use, TrafficScript functions are grouped into families. For example, functions that operate on HTTP requests all begin with “http.”, such as http.getHeader() or http.setBody().
To call a function, use its name followed by a pair of parentheses “()”. Many functions take one or more values as parameters, and these are listed inside the parentheses.
connection.discard();
http.setHeader( "Cookie: type=chocolate" );
$hello = string.append( "Hello", " ", "world", "!" );Function names are not case sensitive. So, the function lang.todouble() can be invoked using lang.toDouble(), Lang.ToDouble() or lang.todouble().
For a description of all TrafficScript functions applicable to this product version, see Function Reference
