# CancelRequest(string, string)

> Checks whether there is a pending request for a specific event and, if there is, cancels it. See EventService.Request for more details on Request.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.MPE](/engine/6000.7/script-reference/unityeditor/mpe.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static bool CancelRequest(string eventType, string message = null)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The event to cancel.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The error message sent to the pending request.

### Returns

| Type                                                          | Description                                                                |
| ------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if a pending request was found and cancelled false otherwise. |
