Interface RefinedRequestProps<TPathParams, TQueryParams, TRequestBody>

Interface representing the refined properties for making an HTTP request.

interface RefinedRequestProps<TPathParams, TQueryParams, TRequestBody> {
    headers: Headers;
    method: string;
    pathParams?: TPathParams;
    queryParams?: TQueryParams;
    requestBody?: TRequestBody;
    responseType: ResponseType;
    retryOptions: {
        backoffMultiplier: number;
        initialDelay: number;
        retries: number;
    };
    timeout: number;
    url: string;
}

Type Parameters

  • TPathParams = PathParams

    Type of the path parameters.

  • TQueryParams = QueryParams

    Type of the query parameters.

  • TRequestBody = any

    Type of the request body.

Properties

headers: Headers

The headers to include in the request.

method: string

The HTTP method for the request.

pathParams?: TPathParams

The path parameters for the request (optional).

queryParams?: TQueryParams

The query parameters for the request (optional).

requestBody?: TRequestBody

The request body for the request (optional).

responseType: ResponseType

The response type for the request.

retryOptions: {
    backoffMultiplier: number;
    initialDelay: number;
    retries: number;
}

The retry options for the request.

Type declaration

  • backoffMultiplier: number

    The multiplier to apply to the delay between subsequent retries. Must be between 1 and 2.

  • initialDelay: number

    The initial delay before the first retry attempt in milliseconds. Must be between 100 and 5000 ms.

  • retries: number

    The number of retry attempts. Must be between 0 and 5.

timeout: number

The timeout for the request in milliseconds.

url: string

The full URL for the request.