Interface MockHttpRequestHandlerOptions<T>

Initialisation parameters for a request handler

interface MockHttpRequestHandlerOptions<T = any> {
    callback?: (handler: MockHttpRequest) => T;
    delay?: number;
    delay_variance?: number;
    metadata?: any;
    method: HttpVerb;
    path: string;
}

Type Parameters

  • T = any

Hierarchy (View Summary)

Properties

callback?: (handler: MockHttpRequest) => T

Callback for handling request to the associated URL

delay?: number

Number of milliseconds the response should be returned

delay_variance?: number

Number of milliseconds the delay value can vary

metadata?: any

Data related to the

method: HttpVerb

HTTP Verb the handler is associated with

path: string

URL path handled by the object