diff options
Diffstat (limited to 'doc/api/url.md')
-rw-r--r-- | doc/api/url.md | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/doc/api/url.md b/doc/api/url.md index 8d9483cb12..a38c79aa12 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -34,24 +34,22 @@ illustrate each. (all spaces in the "" line should be ignored -- they are purely for formatting) ``` -### urlObject.href - -The `href` property is 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'` +### urlObject.auth -### urlObject.protocol +The `auth` property is 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. -The `protocol` property identifies the URL's lower-cased protocol scheme. +For example: `'user:pass'` -For example: `'http:'` +### urlObject.hash -### urlObject.slashes +The `hash` property consists of the "fragment" portion of the URL including +the leading ASCII hash (`#`) character. -The `slashes` property is a `boolean` with a value of `true` if two ASCII -forward-slash characters (`/`) are required following the colon in the -`protocol`. +For example: `'#hash'` ### urlObject.host @@ -60,16 +58,6 @@ the `port` if specified. For example: `'host.com:8080'` -### urlObject.auth - -The `auth` property is 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'` - ### urlObject.hostname The `hostname` property is the lower-cased host name portion of the `host` @@ -77,11 +65,21 @@ component *without* the `port` included. For example: `'host.com'` -### urlObject.port +### urlObject.href -The `port` property is the numeric port portion of the `host` component. +The `href` property is the full URL string that was parsed with both the +`protocol` and `host` components converted to lower-case. -For example: `'8080'` +For example: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` + +### urlObject.path + +The `path` property is a concatenation of the `pathname` and `search` +components. + +For example: `'/p/a/t/h?query=string'` + +No decoding of the `path` is performed. ### urlObject.pathname @@ -94,23 +92,17 @@ For example `'/p/a/t/h'` No decoding of the path string is performed. -### urlObject.search - -The `search` property consists of the entire "query string" portion of the -URL, including the leading ASCII question mark (`?`) character. - -For example: `'?query=string'` +### urlObject.port -No decoding of the query string is performed. +The `port` property is the numeric port portion of the `host` component. -### urlObject.path +For example: `'8080'` -The `path` property is a concatenation of the `pathname` and `search` -components. +### urlObject.protocol -For example: `'/p/a/t/h?query=string'` +The `protocol` property identifies the URL's lower-cased protocol scheme. -No decoding of the `path` is performed. +For example: `'http:'` ### urlObject.query @@ -124,12 +116,20 @@ 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. -### urlObject.hash +### urlObject.search -The `hash` property consists of the "fragment" portion of the URL including -the leading ASCII hash (`#`) character. +The `search` property consists of the entire "query string" portion of the +URL, including the leading ASCII question mark (`?`) character. -For example: `'#hash'` +For example: `'?query=string'` + +No decoding of the query string is performed. + +### urlObject.slashes + +The `slashes` property is a `boolean` with a value of `true` if two ASCII +forward-slash characters (`/`) are required following the colon in the +`protocol`. ## url.format(urlObject) <!-- YAML |