I'm trying to make a simple post request with ajax to a controller in plugin. The problem I'm having is that I always get a 400 Bad request because I don't send a valid CSRF Token.
but this only works in "CP mode", on the front-end the Craft object is not available. I also found that importing it is not a good idea.
So anyone who can tell me how to do this?