UriHelper 类

定义

一个帮助程序类,用于构造在标头和其他 URI 中使用的编码 URI。

public ref class UriHelper abstract sealed
public static class UriHelper
type UriHelper = class
Public Module UriHelper
继承
UriHelper

方法

BuildAbsolute(String, HostString, PathString, PathString, QueryString, FragmentString)

将给定的 URI 组件合并为经过正确编码的字符串,以便在 HTTP 标头中使用。 请注意,HostString 中的 unicode 将编码为 punycode。

BuildRelative(PathString, PathString, QueryString, FragmentString)

将给定的 URI 组件合并为经过正确编码的字符串,以便在 HTTP 标头中使用。

Encode(Uri)

从给定的绝对或相对 URI 生成一个字符串,该字符串经过适当编码,以便在 HTTP 标头中使用。 请注意,unicode 主机名将编码为 punycode。

FromAbsolute(String, String, HostString, PathString, QueryString, FragmentString)

将给定的绝对 URI 字符串分隔为多个组件。 假定没有 PathBase。

GetDisplayUrl(HttpRequest)

返回完全未转义形式的请求 URL 的组合组件 (QueryString) 仅适用于显示。 不应在 HTTP 标头或其他 HTTP 操作中使用此格式。

GetEncodedPathAndQuery(HttpRequest)

返回相对 URI。

GetEncodedUrl(HttpRequest)

以完全转义的形式返回请求 URL 的组合组件,适合在 HTTP 标头和其他 HTTP 操作中使用。

适用于