Sha*_*mun 3 c# antiforgerytoken .net-core asp.net-core
我想授权以下云提供商此 localhost上,在ConfigureServices方法,我Startup.cs文件有
services.AddAntiforgery(options => options.HeaderName = "RequestVerificationToken");
Run Code Online (Sandbox Code Playgroud)
在[HttpGet]控制器方法中,我试图用以下方法验证请求:
await _antiforgery.ValidateRequestAsync(HttpContext);
Run Code Online (Sandbox Code Playgroud)
这是抛出异常.任何人都可以在这里建议我做错了什么?
谢谢!