I have written an axios POST request as recommended from the npm package documentation like:
var data = {
\'key1\': \'val1\',
\'key2\': \'val2\'
}
ax
This might be helpful,
const data = {
email: "me@me.com",
username: "me"
};
const options = {
headers: {
'Content-Type': 'application/json',
}
};
axios.post('http://path', data, options)
.then((res) => {
console.log("RESPONSE ==== : ", res);
})
.catch((err) => {
console.log("ERROR: ====", err);
})
Blockquote
Blockquote