url parse for network
Parse a URL string into structured data.
Signature
> url parse {flags} ...rest
Flags
-
--base, -b {string}: Base URL used to resolve relative URLs.
Parameters
-
...rest: Optionally operate by cell path.
Input/output types:
| input | output |
|---|---|
| string | record |
| table | table |
| record | record |
Examples
Parses a URL.
> 'http://user123:pass567@www.example.com:8081/foo/bar?param1=section&p2=&f[name]=vldc&f[no]=42#hello' | url parse ╭──────────┬──────────────────────────────────────────╮ │ scheme │ http │ │ username │ user123 │ │ password │ pass567 │ │ host │ www.example.com │ │ port │ 8081 │ │ path │ /foo/bar │ │ query │ param1=section&p2=&f[name]=vldc&f[no]=42 │ │ fragment │ hello │ │ │ ╭───┬─────────┬─────────╮ │ │ params │ │ # │ key │ value │ │ │ │ ├───┼─────────┼─────────┤ │ │ │ │ 0 │ param1 │ section │ │ │ │ │ 1 │ p2 │ │ │ │ │ │ 2 │ f[name] │ vldc │ │ │ │ │ 3 │ f[no] │ 42 │ │ │ │ ╰───┴─────────┴─────────╯ │ ╰──────────┴──────────────────────────────────────────╯
Resolves a relative URL against a base URL.
> "../images/logo.png" | url parse --base "https://example.com/products/item1" ╭──────────┬──────────────────╮ │ scheme │ https │ │ username │ │ │ password │ │ │ host │ example.com │ │ port │ │ │ path │ /images/logo.png │ │ query │ │ │ fragment │ │ │ params │ [list 0 items] │ ╰──────────┴──────────────────╯
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/url_parse.html