Class CaseHandlingUriBuilder
- Namespace
- SixLabors.ImageSharp.Web
- Assembly
- SixLabors.ImageSharp.Web.dll
Optimized helper methods for generating encoded Uris from URI components. Much of this code has been adapted from the MIT licensed .NET runtime.
public static class CaseHandlingUriBuilder
- Inheritance
-
CaseHandlingUriBuilder
- Inherited Members
Methods
BuildAbsolute(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.
public static string BuildAbsolute(CaseHandlingUriBuilder.CaseHandling handling, HostString host, PathString pathBase = default, PathString path = default, QueryString query = default)
Parameters
handlingCaseHandlingUriBuilder.CaseHandlingDetermines case handling for the result.
queryis always converted to invariant lowercase.hostHostStringThe host portion of the uri normally included in the Host header. This may include the port.
pathBasePathStringThe first portion of the request path associated with application root.
pathPathStringThe portion of the request path that identifies the requested resource.
queryQueryStringThe query, if any.
Returns
- 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.
public static string BuildAbsolute(CaseHandlingUriBuilder.CaseHandling handling, string scheme, HostString host, PathString pathBase = default, PathString path = default, QueryString query = default)
Parameters
handlingCaseHandlingUriBuilder.CaseHandlingDetermines case handling for the result.
queryis always converted to invariant lowercase.schemestringhttp, https, etc.
hostHostStringThe host portion of the uri normally included in the Host header. This may include the port.
pathBasePathStringThe first portion of the request path associated with application root.
pathPathStringThe portion of the request path that identifies the requested resource.
queryQueryStringThe query, if any.
Returns
- 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.
public static string BuildRelative(CaseHandlingUriBuilder.CaseHandling handling, PathString pathBase = default, PathString path = default, QueryString query = default)
Parameters
handlingCaseHandlingUriBuilder.CaseHandlingDetermines case handling for the result.
queryis always converted to invariant lowercase.pathBasePathStringThe first portion of the request path associated with application root.
pathPathStringThe portion of the request path that identifies the requested resource.
queryQueryStringThe query, if any.
Returns
- 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.
public static string Encode(CaseHandlingUriBuilder.CaseHandling handling, string uri)
Parameters
handlingCaseHandlingUriBuilder.CaseHandlingDetermines case handling for the result.
uristringThe Uri to encode.
Returns
- string
The encoded string version of
uri.
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.
public static string Encode(CaseHandlingUriBuilder.CaseHandling handling, Uri uri)
Parameters
handlingCaseHandlingUriBuilder.CaseHandlingDetermines case handling for the result.
uriUriThe Uri to encode.
Returns
- string
The encoded string version of
uri.