Skip to content

Lupa API Reference / network/types / NetworkRespondPayload

Interface: NetworkRespondPayload

Defined in: src/network/types.ts:44

The static payload definition used to fulfill an intercepted request.

Properties

body?

optional body?: string | ArrayBuffer | null

Defined in: src/network/types.ts:50

The response body. Can be a string, an ArrayBuffer (for binary data), or null.


delay?

optional delay?: number

Defined in: src/network/types.ts:52

Milliseconds to delay the response fulfillment. Useful for simulating latency.


error?

optional error?: "aborted" | "accessdenied" | "addressunreachable" | "blockedbyclient" | "blockedbyresponse" | "connectionaborted" | "connectionclosed" | "connectionfailed" | "connectionrefused" | "connectionreset" | "internetdisconnected" | "namenotresolved" | "timedout" | "failed"

Defined in: src/network/types.ts:54

Triggers a network-level error matching the specified Playwright error string.


headers?

optional headers?: Record<string, string>

Defined in: src/network/types.ts:48

HTTP headers to send back with the response.


status?

optional status?: number

Defined in: src/network/types.ts:46

HTTP status code to return (e.g., 200, 404). Default is 200.