Class CaseHandlingUriBuilder
Optimized helper methods for generating encoded Uris from URI components. Much of this code has been adapted from the MIT licensed .NET runtime.
Inherited Members
Namespace: SixLabors.ImageSharp.Web
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public static class CaseHandlingUriBuilder
Methods
| Edit this page View SourceBuildAbsolute(CaseHandling, HostString, PathString, PathString, QueryString)
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 and the scheme is not included in the result.
Declaration
public static string BuildAbsolute(CaseHandlingUriBuilder.CaseHandling handling, HostString host, PathString pathBase = default, PathString path = default, QueryString query = default)
Parameters
Type | Name | Description |
---|---|---|
CaseHandlingUriBuilder.CaseHandling | handling | Determines case handling for the result. |
HostString | host | The host portion of the uri normally included in the Host header. This may include the port. |
PathString | pathBase | The first portion of the request path associated with application root. |
PathString | path | The portion of the request path that identifies the requested resource. |
QueryString | query | The query, if any. |
Returns
Type | Description |
---|---|
string | The combined URI components, properly encoded for use in HTTP headers. |
BuildAbsolute(CaseHandling, string, HostString, PathString, PathString, QueryString)
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.
Declaration
public static string BuildAbsolute(CaseHandlingUriBuilder.CaseHandling handling, string scheme, HostString host, PathString pathBase = default, PathString path = default, QueryString query = default)
Parameters
Type | Name | Description |
---|---|---|
CaseHandlingUriBuilder.CaseHandling | handling | Determines case handling for the result. |
string | scheme | http, https, etc. |
HostString | host | The host portion of the uri normally included in the Host header. This may include the port. |
PathString | pathBase | The first portion of the request path associated with application root. |
PathString | path | The portion of the request path that identifies the requested resource. |
QueryString | query | The query, if any. |
Returns
Type | Description |
---|---|
string | The combined URI components, properly encoded for use in HTTP headers. |
BuildRelative(CaseHandling, PathString, PathString, QueryString)
Combines the given URI components into a string that is properly encoded for use in HTTP headers.
Declaration
public static string BuildRelative(CaseHandlingUriBuilder.CaseHandling handling, PathString pathBase = default, PathString path = default, QueryString query = default)
Parameters
Type | Name | Description |
---|---|---|
CaseHandlingUriBuilder.CaseHandling | handling | Determines case handling for the result. |
PathString | pathBase | The first portion of the request path associated with application root. |
PathString | path | The portion of the request path that identifies the requested resource. |
QueryString | query | The query, if any. |
Returns
Type | Description |
---|---|
string | The combined URI components, properly encoded for use in HTTP headers. |
Encode(CaseHandling, string)
Generates a string from the given absolute or relative Uri that is appropriately encoded for use in HTTP headers. Note that a unicode host name will be encoded as punycode.
Declaration
public static string Encode(CaseHandlingUriBuilder.CaseHandling handling, string uri)
Parameters
Type | Name | Description |
---|---|---|
CaseHandlingUriBuilder.CaseHandling | handling | Determines case handling for the result. |
string | uri | The Uri to encode. |
Returns
Type | Description |
---|---|
string | The encoded string version of |
Encode(CaseHandling, Uri)
Generates a string from the given absolute or relative Uri that is appropriately encoded for use in HTTP headers. Note that a unicode host name will be encoded as punycode.
Declaration
public static string Encode(CaseHandlingUriBuilder.CaseHandling handling, Uri uri)
Parameters
Type | Name | Description |
---|---|---|
CaseHandlingUriBuilder.CaseHandling | handling | Determines case handling for the result. |
Uri | uri | The Uri to encode. |
Returns
Type | Description |
---|---|
string | The encoded string version of |