WebHeaderCollection.AddWithoutValidate(String, String) Método

Definição

Insere um cabeçalho na coleção sem verificar se o cabeçalho está na lista de cabeçalhos restritos.

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)

Parâmetros

headerName
String

O cabeçalho a ser adicionado à coleção.

headerValue
String

O conteúdo do cabeçalho.

Exceções

headerName é null, Empty ou contém caracteres inválidos.

- ou -

headerValue contém caracteres inválidos.

Somente .NET Framework e .NET Core: headerName não é null, e o comprimento de headerValue é muito longo (maior que 65.535 caracteres).

Comentários

O AddWithoutValidate método adiciona um cabeçalho à coleção sem verificar se o cabeçalho está na lista de cabeçalho restrito.

Observação

O comprimento de headerValue é validado apenas nas versões 2.0 e 3.1 do .NET Framework e do .NET Core.

Notas aos Herdeiros

Use o AddWithoutValidate(String, String) método para adicionar cabeçalhos que normalmente são expostos por meio de propriedades.

Aplica-se a