I have this piece of code in a function called enviar()
which will send data to the backend server.
methods: {
...
enviar() {
this.editable = false
const form = new FormData();
form.append('nombre', this.nombre)
axios.post('http://test.test/test.php', {
data: this.data,
_method: 'patch'
})
},
...
I think it is correct, at least it is according to documentation and this question I read before starting my own.
I have tested so many things, I set up a minimal server (test.test) which has a test.php file which simply is:
POST
<?php print_r($_POST); ?>
GET
<?php print_r($_GET); ?>
I wanted to see if it returns something... and it does!
GET
Array
(
)
POST
Array
(
)
So both $_POST and $_GET
are empty arrays. Even if I change the route to http://test.test/test.php?x=whatever
the $_GET
is still empty
Am I completely doing everything wrong? Am I not getting the point of Axios and whatever?