❔ The correct way to make a http post call in asp.net core mvc 6 web app.

The autoAntiforgery is on in controller, the anitforgery token is injected in view, But I can not make the http call unless I open the inspector and disable cache then refresh the page. thus , it can make the call. How to do such call properly?
14 Replies
Angius
Angius16mo ago
How do you make the call?
🅤🅟🅑🅔🅐🅣 🅛🅘🅕🅔
The ajax call only can be made when inspector is on and disable cache. You refresh the page manually. I think it would be a trick in the view cshtml file.
Angius
Angius16mo ago
How do you send the token with the AJAX call?
🅤🅟🅑🅔🅐🅣 🅛🅘🅕🅔
set the token in the header ChatGpt can not deal it also. lol
Angius
Angius16mo ago
How do you get the token? Show some code, ideally
🅤🅟🅑🅔🅐🅣 🅛🅘🅕🅔
antifogery has method getandstore token
SinFluxx
SinFluxx16mo ago
$details
MODiX
MODiX16mo ago
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, and what you expect the result to be. Upload code here https://paste.mod.gg/ (see $code for more information on how to paste your code)
🅤🅟🅑🅔🅐🅣 🅛🅘🅕🅔
My fault. Some AIs check the code, its no problem. Forget it.
Angius
Angius16mo ago
If you'd rather use ChatGPT than post some code, aight, that's your choice ¯\_(ツ)_/¯
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX16mo ago
.NET documentation
Learn to use .NET to create applications on any platform using C#, F#, and Visual Basic. Browse API reference, sample code, tutorials, and more.
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server