My website is built in laravel 5.4 and hosted on Siteground. The website was working fine before. But now I am randomly getting 500 internal server errors on some ajax request. Sample Code
var csrf_token = $('meta[name="csrf-token"]').attr('content');
var postdata = {
'_token': csrf_token
};
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
url: url,
type: 'POST',
dataType: 'JSON',
data: postdata,
success: function(data) {
},
error: function(data) {
}
});
Kindly help me fix the issue. Thanks in advance.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire