The URLVariables object allows you to transfer variables between an application and a server. Use URLVariables objects with methods of the URLLoader object, with the data property of the URLRequest object, and with Lib.Media.Net package functions.


Can be created with method new:

Lib.Media.Net.URLVariables.new(source)

Creates a new URLVariables object.

source - (default = n0l) - A URL-encoded string containing name/value pairs.


Created URLVariables object has methods:

decode(source)

Converts the variable string to properties of the specified URLVariables object.

source - A URL-encoded query string containing name/value pairs.

get(name)

Returns URL variable value

name - URL variable name

set(name, value)

Sets URL variable value

name - URL variable name

value - URL variable value

toString()

Returns a string containing all enumerable variables, in the MIME content encoding application/x-www-form-urlencoded.



WARNING: starting from LS version 1.12.0 direct object URL variable write and read access deprecated, use get() and set() methods instead.


Example:


vars = Lib.Media.Net.URLVariables.new(nil)

vars.name = "Milla" --deprecated

vars.set("name", "Milla")

vars.set("email", "Jovovich@hotmail.com")

vars.set("submit", "1")

Created with the Personal Edition of HelpNDoc: Create cross-platform Qt Help files