Module jls.net.URL

Represents an URL.

Class URL

URL:new (protocol, host, port, file) Creates a new URL.
url:getHost () Returns this URL hostname.
url:getPort () Returns this URL port.
url:toString () Returns the string value representing this URL.
URL.parse (sUrl) Returns the URL corresponding to the specified string.
URL.fromString (sUrl) Returns the URL corresponding to the specified string.


Class URL

The URL class represents an Uniform Resource Locator. see https://tools.ietf.org/html/rfc1738
URL:new (protocol, host, port, file)
Creates a new URL.

Parameters:

  • protocol The protocol or the URL as a string.
  • host The host name.
  • port The port number.
  • file The file part of the URL.

Returns:

    a new URL

Usage:

    local url = URL:new('http://somehost:1234/some/path')
    url:getHost() -- returns "somehost"
url:getHost ()
Returns this URL hostname.

Returns:

    this URL hostname.
url:getPort ()
Returns this URL port.

Returns:

    this URL port.
url:toString ()
Returns the string value representing this URL.

Returns:

    the string value representing this URL.
URL.parse (sUrl)
Returns the URL corresponding to the specified string.

Parameters:

  • sUrl string The string to parse.

Returns:

    table a table representing the URL or nil.
URL.fromString (sUrl)
Returns the URL corresponding to the specified string.

Parameters:

  • sUrl string The URL as a string.

Returns:

    jls.net.URL the URL or nil.
generated by LDoc 1.4.6 Last updated 2021-11-24 23:10:40