Share via


IAntiforgery.IsRequestValidAsync(HttpContext) Method

Definition

Asynchronously returns a value indicating whether the request passes antiforgery validation. If the request uses a safe HTTP method (GET, HEAD, OPTIONS, TRACE), the antiforgery token is not validated.

public:
 System::Threading::Tasks::Task<bool> ^ IsRequestValidAsync(Microsoft::AspNetCore::Http::HttpContext ^ httpContext);
public System.Threading.Tasks.Task<bool> IsRequestValidAsync (Microsoft.AspNetCore.Http.HttpContext httpContext);
abstract member IsRequestValidAsync : Microsoft.AspNetCore.Http.HttpContext -> System.Threading.Tasks.Task<bool>
Public Function IsRequestValidAsync (httpContext As HttpContext) As Task(Of Boolean)

Parameters

httpContext
HttpContext

The HttpContext associated with the current request.

Returns

A Task<TResult> that, when completed, returns true if the request uses a safe HTTP method or contains a valid antiforgery token, otherwise returns false.

Applies to