Share via


Add Method (String, String)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Inserts a header with the specified name and value into the collection.

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

Syntax

'Declaration
Public Sub Add ( _
    name As String, _
    value As String _
)
public void Add(
    string name,
    string value
)
public:
void Add(
    String^ name, 
    String^ value
)
member Add : 
        name:string * 
        value:string -> unit 
public function Add(
    name : String, 
    value : String
)

Parameters

Remarks

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

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

.NET Framework Security

See Also

Reference

WebHeaderCollection Class

Add Overload

System.Net Namespace