Interface RequestOptions

Options for controlling HTTP request behavior.

interface RequestOptions {
    signal?: AbortSignal;
    timeout?: number;
}

Properties

Properties

signal?: AbortSignal

An AbortSignal to cancel the request. Useful for implementing custom cancellation logic or timeouts.

Example

const controller = new AbortController();
setTimeout(() => controller.abort(), 5000);
await api.post('/path', body, headers, { signal: controller.signal });
timeout?: number

Request timeout in milliseconds. If the request takes longer than this, it will be aborted.