Parsed URL objects have some or all of the following fields, depending on whether or not they exist in the URL string. Any parts that are not in the URL string will not be in the parsed object.

Fields

@:optionaloptionalslashes:Null<Bool>

True if two ASCII forward-slash characters (/) are required following the colon in the protocol.

@:optionaloptionalsearch:Null<String>

The entire "query string" portion of the URL, including the leading ASCII question mark (?) character.

For example: '?query=string'

No decoding of the query string is performed.

@:optionaloptionalquery:Null<EitherType<String, DynamicAccess<String>>>

Either the query string without the leading ASCII question mark (?), or an object returned by the Querystring.parse method.

Whether the query property is a string or object is determined by the parseQueryString argument passed to Url.parse.

For example: 'query=string' or {'query': 'string'}

If returned as a string, no decoding of the query string is performed. If returned as an object, both keys and values are decoded.

The type of this field can be implicitly converted to String or DynamicAccess<String>, where either one is expected, so if you know the actual type, just assign it to properly typed variable (e.g. var s:String = url.query)

@:optionaloptionalprotocol:Null<String>

The URL's lower-cased protocol scheme.

For example: 'http:'

@:optionaloptionalport:Null<String>

The numeric port portion of the host component.

For example: '8080'

@:optionaloptionalpathname:Null<String>

The entire path section of the URL. This is everything following the host (including the port) and before the start of the query or hash components, delimited by either the ASCII question mark (?) or hash (#) characters.

For example '/p/a/t/h'

No decoding of the path string is performed.

@:optionaloptionalpath:Null<String>

Concatenation of the pathname and search components.

For example: '/p/a/t/h?query=string'

No decoding of the path is performed.

@:optionaloptionalhref:Null<String>

The full URL string that was parsed with both the protocol and host components converted to lower-case.

For example: 'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'

@:optionaloptionalhostname:Null<String>

The lower-cased host name portion of the host component without the port included.

For example: 'host.com'

@:optionaloptionalhost:Null<String>

The full lower-cased host portion of the URL, including the port if specified.

For example: 'host.com:8080'

@:optionaloptionalhash:Null<String>

The "fragment" portion of the URL including the leading ASCII hash (#) character.

For example: '#hash'

@:optionaloptionalauth:Null<String>

The username and password portion of the URL, also referred to as "userinfo". This string subset follows the protocol and double slashes (if present) and precedes the host component, delimited by an ASCII "at sign" (@).

The format of the string is {username}[:{password}], with the [:{password}] portion being optional.

For example: 'user:pass'