使用 Postman 测试 .net core 2 页面返回 400 错误请求 [英] test .net core 2 page using Postman return 400 bad request
本文介绍了使用 Postman 测试 .net core 2 页面返回 400 错误请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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
这篇关于使用 Postman 测试 .net core 2 页面返回 400 错误请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文