IAntiforgery.IsRequestValidAsync(HttpContext) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
.