Logos DX
    Preparing search index...

    Interface FetchResponseBase<H, P, RH>

    Fields shared by both branches of the FetchResponse union.

    interface FetchResponseBase<H, P, RH> {
        config: FetchConfig<H, P>;
        headers: Partial<RH>;
        request: Request;
        status: number;
    }

    Type Parameters

    • H

      Type of request headers used in the config

    • P

      Type of request params used in the config

    • RH

      Type of response headers received from the server

    Index

    Properties

    config: FetchConfig<H, P>

    Configuration used for the request.

    The merged configuration object that was used to make this request, including instance-level settings and request-specific overrides. Useful for debugging and understanding how the request was configured.

    headers: Partial<RH>

    HTTP response headers received from the server.

    A plain object containing the response headers with type-safe access to headers you've defined in the InstanceResponseHeaders interface. All header names are preserved as-is from the server response.

    // Define your response headers
    declare module '@logosdx/fetch' {
    namespace FetchEngine {
    interface InstanceResponseHeaders {
    'x-rate-limit': string;
    'x-request-id': string;
    }
    }
    }

    // Now TypeScript knows about your response headers
    const response = await api.get('/users');
    const rateLimit = response.headers['x-rate-limit'];
    const requestId = response.headers['x-request-id'];
    request: Request

    Original request object.

    The Request object that was sent to the server, containing the final URL, headers, method, and body after all modifications and merging of instance and request-specific options.

    status: number

    HTTP status code.

    The numeric HTTP status code (200, 404, 500, etc.) returned by the server. Every completed exchange resolves — status alone decides ok, not a thrown error.