I am trying to send a Json Data received from Formik. Data should look like this, and does look like this when console.log on Before sending:
{ config: {
"dev_token": "merrr",
"scs_date": "2020-02-05",
"user_roll": "homie"
}
}
However when I console log my req.body in Nodejs, I get this:
{
config: '{\n' +
' "dev_token": "merrr",\n' +
' "scs_date": "2020-02-05",\n' +
' "user_roll": "homie"\n' +
'}'
}
Why do I get the data without \n' attached? Any idea how to fix this? The Axios request I made looks like this:
Axios.post("http://localhost:8080/pd/sources/configure/"+this.state.ModalisName,{ "config" :config })
.then(result => {
console.log("PUT result", result)
})
.catch(err =>{
console.log( "PUT err", err);
})