共用方式為


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 驗證時完成的 。

例外狀況

當要求不包含有效的反forgery 權杖時擲回。

適用於