In my webpack project, I am currently using vue-resource for ajax calls. Everything works perfectly with "get" calls, but when I try a post request, my PHP file does not receive any parameters. Even when I use var_dump($_POST), it just gives me an empty array. Here is the basic code snippet I am working with:
let data = {req: 'req_tipe', ch: 001 };
this.$http.post('compute.php', data).then(response => {
// handle response if successful
},
response => {
// deal with errors
});
I can't seem to figure out what I might be missing.
UPDATE: I tried the same approach with axios and vue-axios, but I still face the issue of missing post parameters:
let data = {req: 'req_tipe', ch: 001 };
this.axios.post('compute.php', data).then(response => {
// handle response if successful
},
response => {
// deal with errors
});