node.js - How to pass text/plain content in axios POST request in nodejs -


i want pass body parameters shown in screen shot here (in text/plain format)

i using axios in nodejs/express project . reqeust format 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);         }); }; 

for how can pass body parameters appropriately?

var config = {     headers: {         'content-length': 0,         'content-type': 'text/plain'     },    responsetype: 'text' }; 
  1. responsetype indicates type of data server respond
  2. options arraybuffer , blob , document, json , text, stream

Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

Ansible warning on jinja2 braces on when -