Headers
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1823
The Headers interface of the Fetch API allows you to perform various actions on HTTP request and response headers.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Headers(
init?):Headers
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1824
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Headers
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
IterableIterator<[string,string]>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1866
Returns
Section titled “Returns”IterableIterator<[string, string]>
append()
Section titled “append()”append(
name,value):void
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1849
The append() method of the Headers interface appends a new value onto an existing header inside a Headers object, or adds the header if it does not already exist.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”void
delete()
Section titled “delete()”delete(
name):void
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1855
The delete() method of the Headers interface deletes a header from the current Headers object.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
entries()
Section titled “entries()”entries():
IterableIterator<[string,string]>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1861
Returns
Section titled “Returns”IterableIterator<[string, string]>
forEach()
Section titled “forEach()”forEach<
This>(callback,thisArg?):void
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1856
Type Parameters
Section titled “Type Parameters”This = unknown
Parameters
Section titled “Parameters”callback
Section titled “callback”(this, value, key, parent) => void
thisArg?
Section titled “thisArg?”This
Returns
Section titled “Returns”void
get(
name):null|string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1830
The get() method of the Headers interface returns a byte string of all the values of a header within a Headers object with a given name.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”null | string
getAll()
Section titled “getAll()”getAll(
name):string[]
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1831
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string[]
has(
name):boolean
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1837
The has() method of the Headers interface returns a boolean stating whether a Headers object contains a certain header.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
keys()
Section titled “keys()”keys():
IterableIterator<string>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1863
Returns
Section titled “Returns”IterableIterator<string>
set(
name,value):void
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1843
The set() method of the Headers interface sets a new value for an existing header inside a Headers object, or adds the header if it does not already exist.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”void
values()
Section titled “values()”values():
IterableIterator<string>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1865
Returns
Section titled “Returns”IterableIterator<string>