使用 Postman 测试 .net core 2 页面返回 400 错误请求错误、页面、测试、Postman

由网友(出门不带脑瓜仁)分享简介:I created default project template of .net core 2 pages , than I'm trying to test a call to a page OnPostAsync (not api controller) using postman ,but I always...

I created default project template of .net core 2 pages , than I'm trying to test a call to a page OnPostAsync (not api controller) using postman , but I always get 400 bad request , tried to play with headers etc` but with no success , any 1 manage to do this? After this will work ,my goal is to do do end-to-end/load tests

thanks!

Postman访问.NET Core WebAPI提示无响应

解决方案

answer was found https://github.com/aspnet/Mvc/issues/7012 which it's a workaround to disable IgnoreAntiforgeryToken using [IgnoreAntiforgeryToken(Order = 1001)] on PageModel

阅读全文

相关推荐

最新文章