Interface MockHttpRequestHandler<T>

Interface for data needed to handle Mock HTTP requests

interface MockHttpRequestHandler<T = any> {
    callback?: (handler: MockHttpRequest) => T;
    delay?: number;
    delay_variance?: number;
    metadata?: any;
    method: HttpVerb;
    path: string;
    path_parts: string[];
    path_structure: 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

path_parts: string[]

Parameter keys for set path

path_structure: string[]

Parameter keys for set path