Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ozan's avatar
Level 32

Vue JS $http component TokenMismatchException

I wanted to switch my jquery code to Vue JS and when I send a request I get TokenMismatchException couldn't find any documentation about this.

0 likes
6 replies
Ozan's avatar
Level 32

:D Why so serious? The problem is clear. Are you sure you read my question!? It's about VueJS.

I couldn't find any information about how to send csrf_token() through Vue JS $http extension and I of course I am getting TokenMismatchException.

PS: I know how to create posts, thanks!

1 like
mstnorris's avatar

Well your question isn't clear, you ask for help yet show nothing of what you have so far. Would you expect to get anything meaningful from a Google search with the information you provided?

Please provide some code.

Ozan's avatar
Level 32

Here: Code

I don't have anything special, if you don't have any idea about VueJS and sending headers via its $http extension just don't answer.

davorminchorov's avatar

Send it with the JSON data together as a start to see if it works. Use $http interceptors to send it in the middle of the request later (if there's such thing in Vue)

Ozan's avatar
Level 32

@Ruffles Could be :/

It would be great if there were more information about how to use it. :)

Please or to participate in this conversation.