HttpHeaders.Add HttpHeaders.Add HttpHeaders.Add HttpHeaders.Add Method

Definition

Inserts a new header and its values into the HttpHeaders collection.

Overloads

Add(String, IEnumerable<String>) Add(String, IEnumerable<String>) Add(String, IEnumerable<String>) Add(String, IEnumerable<String>)

Adds the specified header and its values into the HttpHeaders collection.

Add(String, String) Add(String, String) Add(String, String) Add(String, String)

Adds the specified header and its value into the HttpHeaders collection.

Add(String, IEnumerable<String>) Add(String, IEnumerable<String>) Add(String, IEnumerable<String>) Add(String, IEnumerable<String>)

Adds the specified header and its values into the HttpHeaders collection.

public:
 void Add(System::String ^ name, System::Collections::Generic::IEnumerable<System::String ^> ^ values);
public void Add (string name, System.Collections.Generic.IEnumerable<string> values);
member this.Add : string * seq<string> -> unit
Public Sub Add (name As String, values As IEnumerable(Of String))
Parameters
name
String String String String

The header to add to the collection.

values
IEnumerable<String>

A list of header values to add to the collection.

Remarks

The header values will be parsed and validated.

If the specified header does not exist, the Add method inserts a new header into the list of header name/value pairs.

If the specified header is already present, values are added to the comma-separated list of values associated with the header.

Add(String, String) Add(String, String) Add(String, String) Add(String, String)

Adds the specified header and its value into the HttpHeaders collection.

public:
 void Add(System::String ^ name, System::String ^ value);
public void Add (string name, string value);
member this.Add : string * string -> unit
Public Sub Add (name As String, value As String)
Parameters
name
String String String String

The header to add to the collection.

value
String String String String

The content of the header.

Remarks

The header value will be parsed and validated.

If the specified header does not exist, the Add method inserts a new header into the list of header name/value pairs.

If the specified header is already present, value is added to the comma-separated list of values associated with the header.

Applies to