I am new to express framework, in my application I use axios to send HTTP requests to a php server. I am using following code to send POST requests to a php page with parameters 'username' and 'password' as described in the axios documentation. But my php server does not receive any POST parameters, because
echo($_POST['username']);
doesn't return anything. Can anyone tell me what I am doing wrong here & instruct me to correct this without changing the php files? following is the code which I used to send HTTP POST requests
axios.post('http://localhost/test/login.php', {
username: 'test',
password: 'user@test'
})
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error);
});