products.push({'<?php echo $this->security->get_csrf_token_name(); ?>':'<?php echo $this->security->get_csrf_hash(); ?>'});
fetch(url + 'createProducts' ,{
method: 'POST',
credentials: 'same-origin',
mode: 'same-origin',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify(products)
}).then(()=>{alert('done'); console.log(response.json());})
.catch(()=>{alert('error AJAX')});
in products, I have an array of products for my project
ad I am pushing my csrf token too.
But still getting 403 error, please help me resolve this.
Thank You