Optional signalAn AbortSignal to cancel the request. Useful for implementing custom cancellation logic or timeouts.
const controller = new AbortController();
setTimeout(() => controller.abort(), 5000);
await api.post('/path', body, headers, { signal: controller.signal });
Optional timeoutRequest timeout in milliseconds. If the request takes longer than this, it will be aborted.
Options for controlling HTTP request behavior.