ltm rule command URI encode
iRule(1) BIG-IP TMSH Manual iRule(1)
URI::encode
Returns an encoded version of a given URI.
SYNOPSIS
URI::encode URI_STRING
DESCRIPTION
Returns the encoded version of the given URI. For details on URI
encoding, see RFC3986, section 2.1. Percent-Encoding.
This command is equivalent to the BIG-IP 4.X variable encode_uri.
Syntax
URI::encode
* Returns the encoded value of the given uri.
RETURN VALUE
Returns an encoded version of a given URI.
VALID DURING
ANY_EVENT
EXAMPLES
when HTTP_REQUEST {
set my_parameter_value "my URL encoded parameter value with metacharacters (&*@#[])"
log local0. "The encoded version of \"$my_parameter_value\" is \"[URI::encode $my_parameter_value]\""
HTTP::redirect "/path?parameter=[URI::encode $my_parameter_value]"
}
Log output:
The encoded version of "my URL encoded parameter value with metacharacters (&*@#)" is "my%20URL%20encoded%20parameter%20value%20with%20metacharacters%20(%26*%40%23)"
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-9.0.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)