The data representing the mock, which is persisted and used for serving the mock

interface MockData {
    bodyFileName: string;
    creationDateTime?: Date;
    headers?: Readonly<IncomingHttpHeaders>;
    httpVersion?: string;
    ignoredHeaders?: Readonly<IncomingHttpHeaders>;
    status: Readonly<Status>;
    time: number;
    timings?: RequestTimings;
}

Properties

bodyFileName: string

The name of the local file containing the body content (needed since the name is dynamic)

creationDateTime?: Date

Timestamp when the payload was created.

headers?: Readonly<IncomingHttpHeaders>

Recorded headers to be served back, without the ignored ones.

httpVersion?: string

Http version of the server when the mock was recorded. Will most likely be '1.1' or perhaps '1.0'. It is not used when replaying responses.

ignoredHeaders?: Readonly<IncomingHttpHeaders>

Ignored headers, which are recorded headers that should not be served back. In practice, this is mainly the content-length header (because the content-length header that is actually served back is computed based on the actual data to send).

status: Readonly<Status>

HTTP status.

time: number

Time used by the server to process the request. It is used to simulate the real processing time when mocking the server if the delay is set to recorded.

timings?: RequestTimings

Detailed timings recorded during the request.

Generated using TypeDoc