req.body not populating with form data

前端 未结 2 708
栀梦
栀梦 2021-01-20 04:11

The following files are my attempt at submitting a POST request to my nodejs (express) server. The req.body does not populate any sort of data from my form. I have done ma

2条回答
  •  天涯浪人
    2021-01-20 04:54

    You're using the wrong enctype for the form, express by default does not support multipart ( which is used for file uploads ), you need to use x-www-form-urlencoded.

    form(method='post', action='/signup', enctype='application/x-www-form-urlencoded')
    

提交回复
热议问题