Sending form dat in req.body and testing via POSTMAN - having issues

11 views
Skip to first unread message

Lucky Jindal

unread,
Jan 12, 2018, 2:52:08 PM1/12/18
to nodejs
Since I use node.js, I thought it could be node and configuration issue so I am posting my problem here.

1. Front end submits post request
this.http.post('utl', { formData: formData}).subscribe())
So my form data is wrapped in formData.

2. At backend, I catch the POST request via router 
myRouter.post("utl",(req,res)){

   var formData = req.body.formData; // I see formData fine here
}


3. But when I want to test same with POSTMAN or REST Client, I am completely unable to send formData.
I tried -
Postman -> raw body -> "x-www-form-urlencoded "-> different things /ways to set formData and formData contains JSON object. 
Tried application/json too. 


Please help in finding right way to test this, so we do not have to use front end.
Reply all
Reply to author
Forward
0 new messages