I'd want to pass the body parameters indicated in the screenshot.
I am using axios in my nodejs/express project . My request format is as shown below:
var config = {
headers: {
'Content-Length': 0,
'Content-Type': 'text/plain'
}
};
const testInput = (req, res) => {
axios.post('https://api.sandbox.xyz.com/v1/order/new', { firstName: 'Marlon' }, config)
.then(function(response) {
console.log('saved successfully')
})
.catch(function(error) {
console.log(error);
});
};
How can I adequately pass the body parameters in this case?