Headers

external class Headers(init: ReadonlyArray<JsTuple2<String, String>> = definedExternally) : MapLike<String, String> (source)

This Fetch API interface 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.

MDN Reference

Constructors

Link copied to clipboard
constructor(init: ReadonlyRecord<String, String>)
constructor(init: Headers)
constructor(init: ReadonlyArray<JsTuple2<String, String>> = definedExternally)

Functions

Link copied to clipboard
fun append(name: String, value: String)
Link copied to clipboard
Link copied to clipboard
open override fun entries(): JsIterator<JsTuple2<String, String>>
Link copied to clipboard
open override fun forEach(action: (value: String, key: String) -> Unit)
Link copied to clipboard
open operator fun get(key: Symbol.iterator): () -> JsIterator<JsTuple2<String, String>>

operator fun get(name: String): String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open inline operator fun iterator(): Iterator<JsTuple2<String, String>>
Link copied to clipboard
open override fun keys(): JsIterator<String>
Link copied to clipboard
operator fun set(name: String, value: String)
Link copied to clipboard
open override fun values(): JsIterator<String>