UnpackURL (open)
Unpack a URL into its parts
Syntax
LOADLIB "wh::internet/urls.whlib";
RECORD FUNCTION UnpackURL(STRING inurl)Parameters
STRING inurlURL to decode
Return value
RECORDA record explaining this URL
STRING hostThe host to connect to (url-decoded)
BOOLEAN isdefaultportTrue if the port number (explicitly specified or not) is the default for this scheme
BOOLEAN originOrigin of the url (scheme://hostname(:port) - no slash!)
STRING passwordPassword (url-decoded)
INTEGER portThe port to connect to (if not specified, and the URL scheme does not specify a default, it will be 0)
STRING schemeURL Scheme (in lowercase, url-decoded)
STRING schemespecificpartThe data after the colon (NOT decoded!)
BOOLEAN secureTrue if this is a secure (SSL, TLS) protocol
BOOLEAN specifiedportTrue if this URL specified a port number
STRING urlpathThe path and variables requested (NOT decoded! does not include the slash following the hostname/port number)
STRING urlpathslashTrue if the URL path started with a slash
STRING userUsername (url-decoded)
Description
This function splits and parses as much of a URL as possible. The parts it cannot decode, will require a manual DecodeURL when interpreted!