How can I make an outbound HTTP POST request, with data, in node.js?
Posting another axios example of an axios.post request that uses additional configuration options and custom headers.
var postData = {
email: "test@test.com",
password: "password"
};
let axiosConfig = {
headers: {
'Content-Type': 'application/json;charset=UTF-8',
"Access-Control-Allow-Origin": "*",
}
};
axios.post('http://:/', postData, axiosConfig)
.then((res) => {
console.log("RESPONSE RECEIVED: ", res);
})
.catch((err) => {
console.log("AXIOS ERROR: ", err);
})