April 2017
Intermediate to advanced
454 pages
12h 51m
English
The first thing you should do is to discover how your backend is giving you the CSRF token (more on this in the next paragraph). We will suppose that the server will place a cookie in your browser with the name, XSRF-TOKEN.
Axios automatically reads such a cookie and transmits it in the next request.
Consider that we call an Axios get request in our code, as follows:
methods: { sendAllMoney () { axios.get('/sendTo/'+this.accountNo) } }
Axios will pick up that cookie and add a new header to the request called X-XSRF-TOKEN. You can see such headers in the Network
Read now
Unlock full access