The IDLnetURL::Encode static function method encodes a string using "percent encoding" to escape reserved characters. This method is typically used to encode the value field in a name/value pair for HTTP get, put and post requests.

Example


value = IDLnetURL.URLEncode('My JSON string is: {"key":"value"}')
PRINT, value

IDL prints:

My%20JSON%20string%20is%3A%20%7B%22key%22%3A%22value%22%7D

Syntax


Result = Obj->[IDLnetURL::]URLEncode( String )

Return Value


The result is a string containing the encoded value.

Arguments


String

Set this argument to the string to be encoded.

Keywords


None.

 

Version History


8.5.1

Introduced

See Also


IDLnetURL::URLDecode, IDL_BASE64