Answer the question
In order to leave comments, you need to log in
Error on post request (axios)?
So here is the request code
axios.post("http://localhost/users/personalInfo", {
id: "142288"
}).then(response=>{
alert();
}).catch(error=>{
console.log(error);
})
app.post("/users/personalInfo", (req, res) => {
res.setHeader("access-control-allow-credentials", "true");
res.setHeader("access-control-allow-origin", "http://localhost:3000");
// let newData = {...personalInfoData, [req.params.user]: req.params.user}
console.log("Checked");
res.send("Found");
});
Error: Network Error
at createError (createError.js:17)
at XMLHttpRequest.handleError (xhr.js:80)
OPTIONS http://localhost/users/personalInfo?user=142288 net::ERR_CONNECTION_REFUSED
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question