I'm posting a JSON message to an endpoint in my foxx microservice. It's unclear to me how to get the complete JSON in order to parse it:
router.post('/storeDataRecord', (req, res) => {
....
}).body('deviceData');
This is the json:
{
“data”: [
{
“id”: “identifier”,
“key1”: “value1”,
“key2”: “value2”
}
]
}
I've tried with
var request = req.body.deviceData;
var request = req.body.get('data');
can you help me to understand how to navigate the json?