Skip to content

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.

MDN Reference

new Headers(init?): Headers

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1824

HeadersInit

Headers

[iterator](): IterableIterator<[string, string]>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1866

IterableIterator<[string, string]>


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.

MDN Reference

string

string

void


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.

MDN Reference

string

void


entries(): IterableIterator<[string, string]>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1861

IterableIterator<[string, string]>


forEach<This>(callback, thisArg?): void

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1856

This = unknown

(this, value, key, parent) => void

This

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.

MDN Reference

string

null | string


getAll(name): string[]

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1831

string

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.

MDN Reference

string

boolean


keys(): IterableIterator<string>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1863

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.

MDN Reference

string

string

void


values(): IterableIterator<string>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1865

IterableIterator<string>