Interface: FpHeaders
Definido em: 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.
Métodos
Section titled “Métodos”add(name, value): void;Definido em: 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.
Parameters
Section titled “Parameters”| Parameter | Tipo |
|---|---|
name | string |
value | string |
Retorna
Section titled “Retorna”void
count()
Section titled “count()”count(): number;Definido em: fp-api.d.ts:172
Total number of header entries (duplicates counted).
Retorna
Section titled “Retorna”number
get(name): string | undefined;Definido em: fp-api.d.ts:147
Returns the first value for name (case-insensitive), or undefined.
Parameters
Section titled “Parameters”| Parameter | Tipo |
|---|---|
name | string |
Retorna
Section titled “Retorna”string | undefined
getAll()
Section titled “getAll()”getAll(name): string[];Definido em: 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().
Parameters
Section titled “Parameters”| Parameter | Tipo |
|---|---|
name | string |
Retorna
Section titled “Retorna”string[]
remove()
Section titled “remove()”remove(name): void;Definido em: fp-api.d.ts:169
Removes every entry with name. Only effective in pre-request scripts.
Parameters
Section titled “Parameters”| Parameter | Tipo |
|---|---|
name | string |
Retorna
Section titled “Retorna”void
set(name, value): void;Definido em: 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.
Parameters
Section titled “Parameters”| Parameter | Tipo |
|---|---|
name | string |
value | string |
Retorna
Section titled “Retorna”void
toObject()
Section titled “toObject()”toObject(): Record<string, string>;Definido em: 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.
Retorna
Section titled “Retorna”Record<string, string>