W3cubDocs

/Haxe JavaScript

Headers

package js.html

Available on js

The Headers interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence.

Documentation Headers by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Constructor

new(?init:Headers)

new(?init:Array<Array<String>>)

new(?init:DynamicAccess<String>)

Throws:

null

DOMError

Methods

append(name:String, value:String):Void

Appends a new value onto an existing header inside a Headers object, or adds the header if it does not already exist.

Throws:

null

DOMError

delete(name:String):Void

Deletes a header from a Headers object.

Throws:

null

DOMError

entries():HeadersIterator

Returns an Iteration_protocols allowing to go through all key/value pairs contained in this object.

Throws:

null

DOMError

forEach(callback:Dynamic, ?thisArg:Dynamic):Void

Executes a provided function once for each array element.

Throws:

null

DOMError

get(name:String):String

Returns a ByteString sequence of all the values of a header within a Headers object with a given name.

Throws:

null

DOMError

has(name:String):Bool

Returns a boolean stating whether a Headers object contains a certain header.

Throws:

null

DOMError

keys():HeadersIterator

Returns an Iteration_protocols allowing you to go through all keys of the key/value pairs contained in this object.

Throws:

null

DOMError

set(name:String, value:String):Void

Sets a new value for an existing header inside a Headers object, or adds the header if it does not already exist.

Throws:

null

DOMError

values():HeadersIterator

Returns an Iteration_protocols allowing you to go through all values of the key/value pairs contained in this object.

Throws:

null

DOMError

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/Headers.html