query
var query = HttpUtility.ParseQueryString(uri.Query);
foreach (var key in query.AllKeys) {
string value = query[key]; // string value; if multiple then values are comma-separated
var valueArray = query.GetValues(key);
foreach (var s in valueArray) {
string item = s; // string value
}
}
qs
true,7
qs[0]
true
qs[1]
7
properties
AbsoluteUri
https://user:pw@domän.se:456/path/sub/page.html?qs=true&qs=7#hash
Authority
domän.se:456
DnsSafeHost
domän.se
Fragment
#hash
Host
domän.se
HostNameType
Dns
IdnHost
xn--domn-noa.se
IsAbsoluteUri
True
IsDefaultPort
False
IsFile
False
IsLoopback
False
IsUnc
False
LocalPath
/path/sub/page.html
OriginalString
https://user:pw@domän.se:456/path/sub/page.html?qs=true&qs=7#hash
PathAndQuery
/path/sub/page.html?qs=true&qs=7
Port
456
Query
?qs=true&qs=7
Scheme
https
UserInfo
user:pw
UserEscaped
False
Segment[0]
/
Segment[1]
path/
Segment[2]
sub/
Segment[3]
page.html
methods
GetHashCode
-555874764
IsWellFormedOriginalString
True
ToString
https://user:pw@domän.se:456/path/sub/page.html?qs=true&qs=7#hash
Executed on ASP.NET Core 6 on Windows
Note that urls like /folder/file.html are considered absolute file paths on Linux