Laravel uses vue-resource to send ajax requests. How to add CsrfToken,
The following is a demo of using formData to send an ajax request:
{
var formData = new FormData();
// append string
formData.append('foo', 'bar');
// append Blob/File object
formData.append('pic', fileInput, 'mypic.jpg');
// POST /someUrl
this.$http.post('/someUrl', formData).then((response) => {
// success callback
}, (response) => {
// error callback
});
}
The above code will encounter CsrfToken problems. How should I add it?
http://docs.spring.io/spring-...
Bottom