# IDurableHttpClient.CancelOperationAsync(Uri, string?)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.http/orleans.durable.http.idurablehttpclient/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable.http/orleans.durable.http.idurablehttpclient/methods/)

```csharp
public abstract DurableTask<DurableOperation> CancelOperationAsync(Uri operationLocation, string? reason = null)
```

Requests cancellation of an operation with `POST {status monitor}:cancel`, as a step of the calling task.

### Parameters

- `operationLocation` (`Uri`): The URL of the operation's status monitor.
- `reason` (`string?`): The reason which the operation's task reads, or `null` for none.

### Returns

A durable task which returns the operation's status: running while its cancellation proceeds, or terminal.

### Exceptions

- `System.Net.Http.HttpRequestException`: The response doesn't have a success status code.
