Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.46 KB

parse-url-function.md

File metadata and controls

43 lines (29 loc) · 1.46 KB
title description ms.reviewer ms.topic ms.date
parse_url()
Learn how to use the parse_url() function to parse a URL string.
alexans
reference
01/12/2023

parse_url()

Parses an absolute URL string and returns a dynamic object contains URL parts.

Deprecated aliases: parseurl()

Syntax

parse_url(url)

[!INCLUDE syntax-conventions-note]

Parameters

Name Type Required Description
url string ✔️ An absolute URL, including its scheme, or the query part of the URL. For example, use the absolute https://bing.com instead of bing.com.

Returns

An object of type dynamic that included the URL components: Scheme, Host, Port, Path, Username, Password, Query Parameters, Fragment.

Example

[!div class="nextstepaction"] Run the query

print Result=parse_url("scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment")

Output

Result
{"Scheme":"scheme", "Host":"host", "Port":"1234", "Path":"this/is/a/path", "Username":"username", "Password":"password", "Query Parameters":"{"k1":"v1", "k2":"v2"}", "Fragment":"fragment"}