---
name: "up.Request.prototype.abort"
area: "API"
kind: "Instance method"
parent: "up.Request class"
url: "https://unpoly.com/api/up.Request.prototype.abort"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.Request class](https://unpoly.com/api/up.Request.md)</nav>

# up.Request.prototype.abort([options])

Aborts this request.

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

## Example {#example}

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

request.abort()

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

---

## Parameters {#parameters}

### [options.reason] {#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

