W3cubDocs

/Haxe JavaScript

Headers

package js.html

@:native("Headers") 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:

Constructor

new (?init:EitherType<Headers, EitherType<Array<Array<String>>, Dynamic>>)

Throws:

null DOMError

Methods

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

Throws:

null DOMError

@:native("delete") delete_ (name:String):Void

Throws:

null DOMError

entries ():HeadersIterator

Throws:

null DOMError

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

Throws:

null DOMError

get (name:String):String

Throws:

null DOMError

getAll (name:String):Array<String>

Throws:

null DOMError

has (name:String):Bool

Throws:

null DOMError

keys ():HeadersIterator

Throws:

null DOMError

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

Throws:

null DOMError

values ():HeadersIterator

Throws:

null DOMError

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