Skip to main content
Version: 1.11.0

Headers()

The Headers() constructor creates a new Headers object.

Syntax

new Headers()
new Headers(init)

Parameters

  • init optional
    • : An object containing any HTTP headers that you want to pre-populate your Headers object with. This can be a simple object literal with String values, an array of name-value pairs, where each pair is a 2-element string array; or an existing Headers object. In the last case, the new Headers object copies its data from the existing Headers object.