I am fresher to nodejs. How to get the value parameter pass via Delete request? I am using node express js. Thanks in advs
The GET request is sent by calling the request method of the http module. Various options for the GET request can be set through a parameter. const http = require('http'); const querystring = require('querystring'); // GET parameters const parameters = { id: 123, type: "post" } // GET parameters as query string : "?
We can access these route parameters on our req. params object using the syntax shown below. app. get(/:id, (req, res) => { const id = req.params.id; });
The req. params property is an object that contains the properties which are mapped to the named route "parameters". For example, if you have a route as /api/:name, then the "name" property is available as req.params.name. The default value of this object is {}.
You may use "req.body" to get the value of you send
eg:
router.delete('/test',function(req,res){
res.send(req.body.data);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With