$.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name=""]').attr('content') }, type: "POST" }); code example
Example: laravel csrf token ajax post
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});