adspace


How do you extract post data in node.js?

Answer Posted / Preeti Pawar

In Node.js, you can use the built-in `req` object from Express or other popular web frameworks to access the posted data. Here's an example using the body-parser middleware:nn```javascriptnconst express = require('express');nconst bodyParser = require('body-parser');nconst app = express();nnapp.use(bodyParser.json());nnapp.post('/my_route', (req, res) => {n console.log(req.body);n});n``

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can read a file in node js?

568


Is node js losing popularity?

588