Client wysyla dane do node.js za pomocą axiosa w ten sposob
const options = {
url: 'example.com/test',
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json;charset=UTF-8'
},
params: {test:100}
};
axios(options)
.then(response => {
console.log(response);
});
Server odbiera je w ten sposob
app.post('/test',express.json(),(req,res)=>{
console.log('body: ',req.body);
});
i obiekt req.body ktory dostaje server jest pusty, po mimo braku bledow, gdzie moze lezec problem?