HttpEncoder.UrlPathEncode(String) Method

Definition

Encodes a subsection of a URL.

protected internal virtual string UrlPathEncode (string value);

Parameters

value
String

The string to encode.

Returns

A URL-encoded string.

Remarks

The UrlPathEncode method is called by the UrlPathEncode method. The UrlPathEncode method performs the following steps:

  • Applies the encoding logic of the UrlPathEncode method to only the path part of the URL (which excludes the query string). The method assumes that the URL is encoded as a UTF-8 string.

  • Encodes non-spaces so that only a subset of the first 128 ASCII characters is used in the resulting encoded string. Any characters at Unicode value 128 and greater, or 32 and less, are URL-encoded.

  • Encodes spaces as %20.

Applies to

Produkt Versjoner
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1