UriHelper.BuildRelative 方法

定义

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

public static string BuildRelative (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 BuildRelative : Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.QueryString * Microsoft.AspNetCore.Http.FragmentString -> string
Public Function BuildRelative (Optional pathBase As PathString = Nothing, Optional path As PathString = Nothing, Optional query As QueryString = Nothing, Optional fragment As FragmentString = Nothing) As String

参数

pathBase
PathString

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

path
PathString

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

query
QueryString

查询(如果有)。

fragment
FragmentString

片段(如果有)。

返回

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

适用于