Share via


UriHelper.BuildAbsolute Method

Definition

Combines the given URI components into a string that is properly encoded for use in HTTP headers. Note that unicode in the HostString will be encoded as 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

Parameters

scheme
String

http, https, etc.

host
HostString

The host portion of the uri normally included in the Host header. This may include the port.

pathBase
PathString

The first portion of the request path associated with application root.

path
PathString

The portion of the request path that identifies the requested resource.

query
QueryString

The query, if any.

fragment
FragmentString

The fragment, if any.

Returns

The combined URI components, properly encoded for use in HTTP headers.

Applies to