gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 06:56:26 25 4
gpt4 key购买 nike

我创建了 .net core 2 页面的默认项目模板,然后尝试使用 postman 测试对页面 OnPostAsync (不是 api Controller )的调用,但我总是收到 400 错误请求,尝试使用 header 等,但没有成功,有谁能做到这一点吗?
在此之后,我的目标是进行端到端/负载测试

谢谢!

enter image description here enter image description here

enter image description here

enter image description here

最佳答案

找到答案 https://github.com/aspnet/Mvc/issues/7012这是在 PageModel 上使用 [IgnoreAntiforgeryToken(Order = 1001)] 禁用 IgnoreAntiforgeryToken 的解决方法

enter image description here

关于asp.net-core - 使用Postman测试.net core 2页面返回400错误请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47453401/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com