The payload represents the content of an HTTP response from the backend, no matter if it actually comes from it or if it was created manually.

Remarks

A payload is often wrapped in PayloadWithOrigin. To create the wrapped payload, you can use createPayload.

From the wrapped payload, response to the client can be filled with fillResponseFromPayload.

The payload can also be persisted and read, to avoid contacting the backend later on.

interface Payload {
    body: null | string | Buffer;
    data: MockData;
}

Properties

Properties

body: null | string | Buffer

Body of the HTTP response.

data: MockData

Data such as http status and headers, response delay.

Generated using TypeDoc