Represents the parameters for making an HTTP request.

This interface specifies options for configuring an HTTP request, including query parameters, request body, custom headers, and a function to validate response headers.

interface HttpParams {
    body?: unknown;
    headers?: Record<string, string>;
    query?: Record<string, string>;
    validateResponseHeader?: ((headers: Record<string, string>) => void);
}

Properties

body?: unknown

The request body, which can be of any type.

headers?: Record<string, string>

Custom headers to be included in the request.

query?: Record<string, string>

Query parameters to include in the request.

validateResponseHeader?: ((headers: Record<string, string>) => void)

A callback function to validate response headers.

Type declaration

    • (headers): void
    • Parameters

      • headers: Record<string, string>

        The response headers to validate.

      Returns void