POST plain text (from another API) simulate with postman using plain text
{ "name":"brad" , "address":"mystreet" }
on Node:
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.post('/api/test', function (req, res) {
var contact = req.body;
console.log(contact);
});
Got these on the console:
{ '{\n"name":"brad",\n"address":"mystreet"\n}': '' }
How to make use or convert those text into a JSON data (formatted)?.