WebHeaderCollection.AddWithoutValidate(String, String) 方法

定义

将标头插入到集合中,不检查此标头是否在受限制的标头列表上。

protected:
 void AddWithoutValidate(System::String ^ headerName, System::String ^ headerValue);
protected void AddWithoutValidate (string headerName, string? headerValue);
protected void AddWithoutValidate (string headerName, string headerValue);
member this.AddWithoutValidate : string * string -> unit
Protected Sub AddWithoutValidate (headerName As String, headerValue As String)

参数

headerName
String

要添加到集合中的标头。

headerValue
String

标头的内容。

例外

headerNamenullEmpty,或者包含无效字符。

- 或 -

headerValue 包含无效字符。

仅限 .NET Framework 和 .NET Core:headerName 不是 null,并且 headerValue 的长度过长(大于 65,535 个字符)。

注解

方法 AddWithoutValidate 将标头添加到集合中,而不检查标头是否在受限标头列表中。

注意

的长度headerValue仅在 .NET Framework 和 .NET Core 版本 2.0 - 3.1 中验证。

继承者说明

AddWithoutValidate(String, String)使用 方法添加通常通过属性公开的标头。

适用于