Mocky Balboa API Reference
    Preparing search index...

    Interface FetchOptions

    Options when fetching a route using fetch

    interface FetchOptions {
        followRedirects?: boolean;
        headers?: Record<string, string>;
        keepalive?: boolean;
        maxRetries?: number;
        method?: string;
        postData?: string;
        timeout?: number;
        url?: string;
    }
    Index

    Properties

    followRedirects?: boolean

    Whether to follow redirects or not.

    true
    
    headers?: Record<string, string>

    Optional headers to override the original request headers

    keepalive?: boolean

    Whether to keep the connection alive or not

    false
    
    maxRetries?: number

    Maximum number of retries to attempt before giving up.

    20
    

    A retry is only attempted if there's a network error. Any responses from the server irregardless of their status code will be treated as a successful request.

    method?: string

    HTTP method to use when fetching the route, defaults to the method on the original request

    postData?: string

    Override the request body

    Only used when method is not GET or HEAD

    timeout?: number

    Timeout for the request to complete in milliseconds

    30_000
    
    url?: string

    The request URL, optionally override the original request URL