IAntiforgery.ValidateRequestAsync(HttpContext) 方法

定义

验证作为请求的一部分提供的防伪造令牌。

public:
 System::Threading::Tasks::Task ^ ValidateRequestAsync(Microsoft::AspNetCore::Http::HttpContext ^ httpContext);
public System.Threading.Tasks.Task ValidateRequestAsync (Microsoft.AspNetCore.Http.HttpContext httpContext);
abstract member ValidateRequestAsync : Microsoft.AspNetCore.Http.HttpContext -> System.Threading.Tasks.Task
Public Function ValidateRequestAsync (httpContext As HttpContext) As Task

参数

httpContext
HttpContext

HttpContext与当前请求关联的 。

返回

Task 验证完成时完成的 。

例外

当请求不包含有效的防伪造令牌时引发。

适用于