vapor-chamber API reference - v1.16.0
    Preparing search index...

    Type Alias HttpRequestConfig

    HttpRequestConfig: HttpConfig & {
        method?: HttpMethod;
        data?: unknown;
        params?: Record<string, unknown>;
        baseURL?: string;
        responseType?: ResponseType;
        cache?:
            | boolean
            | { ttl?: number; staleTtl?: number; serveStaleOnError?: boolean };
        dedupe?: boolean;
    }

    Type Declaration

    • Optionalmethod?: HttpMethod

      HTTP method. Default: 'GET'

    • Optionaldata?: unknown

      Request body (auto-serialized if object, passthrough for FormData)

    • Optionalparams?: Record<string, unknown>

      Query parameters — supports arrays and nested objects

    • OptionalbaseURL?: string

      Base URL prepended to relative paths

    • OptionalresponseType?: ResponseType

      Response parsing mode. Default: 'json'

    • Optionalcache?: boolean | { ttl?: number; staleTtl?: number; serveStaleOnError?: boolean }

      Enable LRU caching for GET. true = default TTL, no stale window. { ttl } sets the fresh-window duration. { staleTtl } opts into stale-while-revalidate: a hit within ttl + staleTtl past ttl is served instantly with { stale: true, revalidation: Promise } attached, while a background fetch refreshes the entry. serveStaleOnError is a separate opt-in: a transient failure (timeout/network/5xx) with ANY retained entry (even past its stale window) resolves to { stale: true, servedOnError: true, error } instead of rejecting.

    • Optionaldedupe?: boolean

      Enable request deduplication for GET. Default: true