Skip to content

Headers

TThe Headers() constructor creates a new Headers object.

new Headers();
new Headers(init);
Parameters
  • init (optional)

    An object containing any HTTP headers you want to prepopulate 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.