up.Request up.Request.prototype.abort([options])
Instance method

Aborts this request.

The request's promise will reject with an up.Aborted error.

Example

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

request.abort()

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

Parameters

[options.reason]
optional

A message describing the reason for aborting this request.

If omitted, a generic reason like "Aborted request to GET /path" will be used.

The reason will be set as the error's message.

Type: string