Web APIs

Request.signal

Try the free JavaScript compiler

Returns the cancellation signal associated with a Request. A supplied signal is followed by the request signal, which need not be the same object.

Formal Syntax & Structure

javascript syntaxjavascript
request.signal

Return Value

AbortSignal

Request cancellation signal.

Working Example

Example Snippetjavascript
const c=new AbortController(); const r=new Request("https://example.invalid/items",{signal:c.signal}); c.abort("closed"); console.log(r.signal.aborted,r.signal.reason);
JavaScript Reference