I want to send a post rquest with axios that has body data and form data and I can get anything to reach through to my route hadler:
axios({
method: 'POST',
url: `${keys.SERVER_URL}/post/new-post/${isAuthenticated()._id}`,
formData,
data: { title, content },
headers: {
'Content-Type': 'application/json',
'Content-Type': 'multipart/form-data',
},
});
then in the route handler I console.log and I get nothing:
app.post("/new-post", (req, res) => {
console.log(req.body);
console.log(req.file):
});