i'm developing a node.js api for a simple app for the first time and i'm confused about receiving data on body.
The code:
router.route("/ReceiveJSON").get((request, response) => {
console.log(request.body);
response.send("ok");
});
I'm sending this on Postman to test:
{
"name": "test"
}
So i'm supposed to get this text on console, but i only get "{}" on console.
What am i doing wrong?
I dont know if this is causing the problem but i algo got the message "(node:11396) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use node --trace-deprecation ...
to show where the warning was created)" on console (but im not even using headers)