且构网

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

ASP.NET Core Razor-AJAX发布-400错误的请求

更新时间:2021-09-15 08:39:34

因此,阅读上面的修订并发表评论时没有任何困惑(这让我ing了一会儿),解决方案是更改:

Just so there's no confusion in reading the revisions above and comment (which left me scratching my head for a minute), the solution is to change:

xhr.setRequestHeader("XSRF-TOKEN",

收件人:

xhr.setRequestHeader("RequestVerificationToken",

答案在修订本中,有人编辑了它.评论中还简要提到了它.我当然不相信任何人,只是想尽量减少将来遇到这种精神错乱而犯错误的其他人的困惑.

The answer is in the revision and the someone edited it out. It's also mentioned briefly in the comments. I'm certainly not taking any credit, just trying to minimize confusion for anyone else that encounters this insanity making error in the future.