Skip to main content

Windows Dev Center

HttpResponseHeaderCollection.Insert | insert method

Inserts or replaces an item in the HttpResponseHeaderCollection with the specified key and value.

Syntax


var boolean = httpResponseHeaderCollection.insert(key, value);

public:
bool Insert(
  String^ key, 
  String^ value
)

Parameters

key

Type: String [JavaScript] | Platform::String [C++]

The key of the item to be inserted.

value

Type: String [JavaScript] | Platform::String [C++]

The value of the item to insert.

Return value

Type: Boolean [JavaScript] | Platform::Boolean [C++]

true if an item with the specified key is an existing item that was replaced; otherwise false.

Remarks

When programming with .NET, this method is hidden and developers should use one of the Add methods.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Web.Http.Headers
Windows::Web::Http::Headers [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Web.Http.Headers
Windows::Web::Http::Headers [C++]

Metadata

Windows.winmd

See also

HttpResponseHeaderCollection