Skip to content

Interface: FpHeaders

Defined in: fp-api.d.ts:145

Case-insensitive header accessor.

Header names are matched case-insensitively for reads/writes but the original casing is preserved when the request is serialised.

add(name, value): void;

Defined in: fp-api.d.ts:166

Appends a header value, keeping any existing same-name entries — use this to author duplicate headers. Only effective in pre-request scripts.

ParameterType
namestring
valuestring

void


count(): number;

Defined in: fp-api.d.ts:172

Total number of header entries (duplicates counted).

number


get(name): string | undefined;

Defined in: fp-api.d.ts:147

Returns the first value for name (case-insensitive), or undefined.

ParameterType
namestring

string | undefined


getAll(name): string[];

Defined in: fp-api.d.ts:154

Returns every value for name (case-insensitive), in order. A header name may legitimately repeat (e.g. multiple Accept or Set-Cookie); this is how you read all of them without the first-match collapse of get().

ParameterType
namestring

string[]


remove(name): void;

Defined in: fp-api.d.ts:169

Removes every entry with name. Only effective in pre-request scripts.

ParameterType
namestring

void


set(name, value): void;

Defined in: fp-api.d.ts:160

Sets a header value, replacing every existing entry with that name. Only effective in pre-request scripts — throws in post-response.

ParameterType
namestring
valuestring

void


toObject(): Record<string, string>;

Defined in: fp-api.d.ts:178

Snapshot of all headers as a plain object. Lossy for duplicates (the last value wins) — use FpHeaders.getAll to read repeated names.

Record<string, string>