Hi,
Spending hours to post some vuejs - axios data to my codeigniter.
In my config the token name is "csrf_token". csrf_regenerate is FALSE just to simplify the problem.
http://puppyplaza.dev/api/save profile is a for now a simple controller to display the result (on my localhost)
With Jquery it works![Smile Smile]()
data: {'csrf_token':'b2897db3f48b2c08c7313f280b290eb3'},
With axios it wont!
![[Image: error.png]]()
Please, please anyone!?
Spending hours to post some vuejs - axios data to my codeigniter.
PHP Code:
axios({
method: 'post',
url: 'http://puppyplaza.dev/api/saveprofile',
data: {
csrf_token: 'b2897db3f48b2c08c7313f280b290eb3',
email: this.profile.email
}
})
In my config the token name is "csrf_token". csrf_regenerate is FALSE just to simplify the problem.
http://puppyplaza.dev/api/save profile is a for now a simple controller to display the result (on my localhost)
PHP Code:
public function saveprofile()
{
$data = array('data'=> 'data to send back to browser');
$this->load->helper('security');
//$this->input->post('csrf_token');
//$csrf = $this->security->get_csrf_hash();
$this->output
->set_content_type('application/json')
->set_output(json_encode(array('data' => $data, 'csrf' => $csrf)));
}
With Jquery it works

data: {'csrf_token':'b2897db3f48b2c08c7313f280b290eb3'},
With axios it wont!
![[Image: error.png]](http://buroponzo.nl/error.png)
Please, please anyone!?