Skip to main content

Uri.Parts

Returns the parts of the input absolute URI as a record.

Syntax

Uri.Parts(
absoluteUri as text
) as record

Remarks

Returns the parts of the input absoluteUri as a record, containing values such as Scheme, Host, Port, Path, Query, Fragment, UserName and Password.

Examples

Example #1

Find the parts of the absolute URI "www.adventure-works.com".

Uri.Parts("www.adventure-works.com")

Result:

[
Scheme = "http",
Host = "www.adventure-works.com",
Port = 80,
Path = "/",
Query = [],
Fragment = "",
UserName = "",
Password = ""
]

Example #2

Decode a percent-encoded string.

let
UriUnescapeDataString = (data as text) as text => Uri.Parts("http://contoso?a=" & data)[Query][a]
in
UriUnescapeDataString("%2Bmoney%24")

Result:

"+money$"

Category

Uri