UriHelper.Encode(Uri) Method

Definition

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.

C#
public static string Encode (Uri uri);

Parameters

uri
Uri

The Uri to encode.

Returns

The encoded string version of uri.

Applies to

Produkt Verzie
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0