Hello, I have to send the information of an html form via POST to a crud on node and mongodb! I can not do it! follows the code below:
pastebin code: link
Hello, I have to send the information of an html form via POST to a crud on node and mongodb! I can not do it! follows the code below:
pastebin code: link
body-parser
does not provide support for Content-Type
multipart/form-data
. For this you can use middleware
like multer
. To do this, just adapt your routes that will receive the contents of form
as follows:
// Importações
const multer = require('multer');
const upload = multer();
...
.post(upload.any(), function(req,res) {
...
So the content of the fields will be present in req.body
.