# Cancellation Token in Requests

A token that is cancelled when the client disconnects.

## What is **Cancellation Token in Requests**?

Add a `CancellationToken` parameter to a handler and ASP.NET Core cancels it if the client disconnects. Pass it to database and HTTP calls so abandoned requests stop working.

```csharp
app.MapGet("/reports/{id:int}", async (int id, IReportService reports, CancellationToken ct) =>
    await reports.BuildAsync(id, ct));
```

Level: Freelancer · [More ASP.NET Core terms at this level](https://www.ask-codey.com/glossary?category=aspnet-core&level=4)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/cancellation-token-in-requests
