Headers.prototype.forEach

Calls a function for each header contained in the Headers object.

Syntax

forEach(fn)

Parameters

Return value

undefined

Examples

let headers = new Headers({ "content-type": "application/json", "accept-encoding": "gzip" })
headers.forEach((key, value) => {
  print(`${key}: ${value}`)
})
content-type: application/json
accept-encoding: gzip