During testing your REST API, you could meet the error undefined for your input parameters of your form when you testing your POST with the POSTMAN tools. Typically , you obtain the error req.body.myparameter undefined.
One case of error, maybe you use the wrong tab inside the POSTMAN software.
When beginning , we often use the first tab params as in the picture below :

req.body undefined postman nodejs post

In my case, i solve this problem by using, the tab Body and the option x-www-form-urlencoded as in the picture below :

I hope this tip could allow you to solve a similar problem.

Laisser un commentaire