HttpEncoder.UrlPathEncode(String) 方法

定义

对 URL 的子部分进行编码。

protected public:
 virtual System::String ^ UrlPathEncode(System::String ^ value);
protected internal virtual string UrlPathEncode(string value);
abstract member UrlPathEncode : string -> string
override this.UrlPathEncode : string -> string
Protected Friend Overridable Function UrlPathEncode (value As String) As String

参数

value
String

要编码的字符串。

返回

URL 编码的字符串。

注解

该方法 UrlPathEncodeUrlPathEncode 该方法调用。 该方法 UrlPathEncode 执行以下步骤:

  • 将方法的 UrlPathEncode 编码逻辑应用于 URL 的路径部分(不包括查询字符串)。 该方法假定 URL 编码为 UTF-8 字符串。

  • 对非空格进行编码,以便在生成的编码字符串中仅使用前 128 个 ASCII 字符的子集。 Unicode 值 128 及更高(或 32 及更低)的任何字符均采用 URL 编码。

  • 将空格编码为 %20。

适用于