Share via


UriHelper Class

Definition

A helper class for constructing encoded Uris for use in headers and other Uris.

public ref class UriHelper abstract sealed
public static class UriHelper
type UriHelper = class
Public Module UriHelper
Inheritance
UriHelper

Methods

BuildAbsolute(String, HostString, PathString, PathString, QueryString, FragmentString)

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.

BuildRelative(PathString, PathString, QueryString, FragmentString)

Combines the given URI components into a string that is properly encoded for use in HTTP headers.

Encode(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.

FromAbsolute(String, String, HostString, PathString, QueryString, FragmentString)

Separates the given absolute URI string into components. Assumes no PathBase.

GetDisplayUrl(HttpRequest)

Returns the combined components of the request URL in a fully un-escaped form (except for the QueryString) suitable only for display. This format should not be used in HTTP headers or other HTTP operations.

GetEncodedPathAndQuery(HttpRequest)

Returns the relative URI.

GetEncodedUrl(HttpRequest)

Returns the combined components of the request URL in a fully escaped form suitable for use in HTTP headers and other HTTP operations.

Applies to