Po stronie clienta
const options = {
url: 'http://localhost:3000/api/newaccount',
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json;charset=UTF-8'
},
data: {
name: 'test'
}
};
axios(options)
.then(response => {
console.log(response.status);
});
Po stronie servera:
app.get('/api/newaccount',(req,res)=>{
console.log(req.query);
res.send('null');
});
Problem w tym że req.query to pusty obiekt bez właściwości "name" którą axios powinien wysłać, nie rozumiem dlaczego tak się dzieje