Add Method (String, IEnumerable(String))
Collapse the table of content
Expand the table of content

HttpHeaders.Add Method (String, IEnumerable<String>)

.NET Framework 4.6 and 4.5

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

Namespace:   System.Net.Http.Headers
Assembly:  System.Net.Http (in System.Net.Http.dll)

public void Add(
	string name,
	IEnumerable<string> values


Type: System.String

The header to add to the collection.

Type: System.Collections.Generic.IEnumerable<String>

A list of header values to add to the collection.

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.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft