Pular para o conteúdo

Interface: FpRequest

Definido em: fp-api.d.ts:32

Mutable view of the outgoing HTTP request.

In pre-request scripts every field is writable — changes are persisted to the request that is actually sent.

In post-response scripts the fetch already occurred; assigning to any field throws at runtime. A future refinement (REQ-42) will type this as Readonly<FpRequest> in post-response.

readonly binaryFileRef: string | undefined;

Definido em: fp-api.d.ts:71

Reference to the staged binary file when bodyType === 'binary', undefined otherwise. The reference is opaque (<sha256>__<name>) and read-only — scripts cannot mutate the binary attachment from a script.


body: string | FpMultipartBody | undefined;

Definido em: fp-api.d.ts:58

Request body. The shape depends on bodyType:

  • 'none': undefined.
  • 'raw' / 'x-www-form-urlencoded': a string (mutable in pre-request).
  • 'binary': NOT exposed — reads as undefined, writes throw. Use binaryFileRef for the staged-file identifier; the bytes themselves stay in the host realm.
  • 'multipart-form': an FpMultipartBody object with a parts array. Mutate via body.parts.push(...), indexed access, or splice. File parts may only be added by referencing an already-staged fileRef — raw bytes are never accepted from scripts.

Assigning null/undefined clears string bodies. Assigning to a multipart body throws — mutate the parts array instead.


readonly bodyType: "none" | "raw" | "x-www-form-urlencoded" | "binary" | "multipart-form";

Definido em: fp-api.d.ts:64

Body mode the user picked in the editor. Read-only — switching modes is a user action, not a script action.


headers: FpHeaders;

Definido em: fp-api.d.ts:40

Case-insensitive header accessor.


method: string;

Definido em: fp-api.d.ts:34

HTTP method (e.g. “GET”, “POST”). Case-preserved.


url: string;

Definido em: fp-api.d.ts:37

Fully-resolved URL with interpolated {{variables}}.