Edit this page

up.Request up.Request.prototype.abort()
Class method

This feature is experimental. It may be changed or removed in a future version.

Aborts this request.

The request's promise will reject with an error object that has { name: 'AbortError' }.

Example

let request = await up.request('/path')

try {
  let response = await request('/path')
} catch (result) {
  if (result.name === 'AbortError') {
    console.log('Request was aborted.')
  }
}

request.abort()
This website uses cookies to improve usability and analyze traffic.
I accept or learn more