Get the total number of headers
Symbol
__internal.BunHeadersOverride
interface BunHeadersOverride
Get all headers matching the name
Only supports
"Set-Cookie"
. All other headers are empty arrays.@param nameThe header name to get
@returnsAn array of header values
const headers = new Headers(); headers.append("Set-Cookie", "foo=bar"); headers.append("Set-Cookie", "baz=qux"); headers.getAll("Set-Cookie"); // ["foo=bar", "baz=qux"]
Convert Headers to a plain JavaScript object.
About 10x faster than
Object.fromEntries(headers.entries())
Called when you run
JSON.stringify(headers)
Does not preserve insertion order. Well-known header names are lowercased. Other header names are left as-is.