1 $.ajax({
2 url: "/route/to",
3 type: 'POST',
4 beforeSend: function (request) {
5 return request.setRequestHeader('X-CSRF-Token', $("meta[name='csrf-token']").attr('content'));
6 },
7 success: data => {
8 console.log(data);
9 }
10 });