且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-02-16 20:47:52

答案原为找到


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!

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