I want to have a AJAX post request. So, what I have one is like it-
$(document).ready(function()
{
var baseURL = $('meta[name=base_url]').attr("content")+'/';
var lastClicked = 0;
var token = $('meta[name=csrf_token]').attr("content");
$( "#button_yes,#button_no" ).click(function()
{
var now = new Date();
if(now - lastClicked > 10000)
{
lastClicked = now;
console.log('Done');
$.ajax(
{
headers: { 'X-CSRF-TOKEN': token},
url: baseURL+"add_votes",
success: function(result)
{
alert(result);
console.log(result);
console.log(token);
},
method: "POST",
data:
{
_token: token,
uuid : $('meta[name=webniar_ID]').attr("content")
},
});
}
});
});
So, more specifically-
$.ajax(
{
headers: { 'X-CSRF-TOKEN': token},
url: baseURL+"add_votes",
success: function(result)
{
alert(result);
console.log(result);
console.log(token);
},
method: "POST",
data:
{
_token: token,
uuid : $('meta[name=webniar_ID]').attr("content")
},
});
But I am getting a 407 Error
Can anyonehelp me please?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire