Options for controlling HTTP request behavior.
Optional
An 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 }); Copy
const controller = new AbortController();setTimeout(() => controller.abort(), 5000);await api.post('/path', body, headers, { signal: controller.signal });
Request timeout in milliseconds. If the request takes longer than this, it will be aborted.
Options for controlling HTTP request behavior.