URL Component

URL component is used for parsing and manipulating URL's. Parts of the URL can be manipulated separately.

Creating an instance of URL:

From scripting you can create a variable of the type URL by the following code:
myURL = new TURL('http://someurl');
where the parameter to the constructor is the initial URL the new instance should be created with.

Example:

myURL = new TURL(''); myURL.URL = "http://username:password@www.host.com:80/path/file.script?param=value"; Trace("Scheme=" + myURL.Scheme); Trace("User=" + myURL.User); Trace("Pass=" + myURL.Pass); Trace("Host=" + myURL.Host); Trace("Port=" + myURL.Port); Trace("Path=" + myURL.Path); Trace("GetVar=" + myURL.GetVar); myURL.Scheme = "HTTPS"; myURL.Port = "443"; Trace("URL=" + myURL.URL);

The above code will produce the following debug output:

Scheme=http User=username Pass=password Host=www.host.com Port=80 Path=/path/file.script GetVar=param=value URL=HTTPS://username:password@www.host.com:443/path/file.script?param=value

Functions:

Properties:

function isHTTP()

Return value:

This function returns true if the scheme part of the URL is either omitted or is HTTP or HTTPS.

function isEquivalentWithURL(URL)

Compares two URLs to determine if they are equivalent. Two URLs are equivalent if their scheme, port, host and path parts are equal. If port is omitted in the URLs it is defaulted to 80 in case of HTTP scheme or 443 in case of HTTPS scheme. If scheme is omitted it is defaulted to HTTP.

Parameter list:

property URL

Read and write property of type string containing the whole URL.

property Scheme

Read and write property of the type string which contains the scheme part of the URL

property User

Read and write property of the type string which contains the user name part of the URL

property Pass

Read and write property of the type string which contains the password part of the URL

property Port

Read and write property of the type string which contains the port from the URL

property Path

Read and write property of the type string which contains the path part of the URL

property GetVar

Read and write property of the type string which contains the query string from the URL

property CaseInsensitive

Read and write property of the type boolean. If this property is true the parts of the URL will be automatically converted to lowercase.

property Host

Read and write property of the type string which contains the host part from the URL