UriHelper.BuildAbsolute 方法

定义

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

public static string BuildAbsolute (string scheme, Microsoft.AspNetCore.Http.HostString host, Microsoft.AspNetCore.Http.PathString pathBase = default, Microsoft.AspNetCore.Http.PathString path = default, Microsoft.AspNetCore.Http.QueryString query = default, Microsoft.AspNetCore.Http.FragmentString fragment = default);
static member BuildAbsolute : string * Microsoft.AspNetCore.Http.HostString * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.QueryString * Microsoft.AspNetCore.Http.FragmentString -> string
Public Function BuildAbsolute (scheme As String, host As HostString, Optional pathBase As PathString = Nothing, Optional path As PathString = Nothing, Optional query As QueryString = Nothing, Optional fragment As FragmentString = Nothing) As String

参数

scheme
String

http、https 等。

host
HostString

通常包含在 Host 标头中的 uri 的主机部分。 这可能包括 端口。

pathBase
PathString

与应用程序根关联的请求路径的第一部分。

path
PathString

标识所请求资源的请求路径部分。

query
QueryString

查询(如果有)。

fragment
FragmentString

片段(如果有)。

返回

组合的 URI 组件,经过正确编码以用于 HTTP 标头。

适用于