I'm trying to get the username and password from a form:
<!DOCTYPE html>
<form action="" method="post" enctype="application/x-www-form-urlencoded">
Username:<br>
<input type="text" name="Username" value="Username">
<br>
Password:<br>
<input type="text" name="Password" value="Password">
<br><br>
<input type="submit" value="Submit">
</form>
This is then received by this:
app.post('/login', function(req, res){
console.log(req.body.username);
console.log(req.body.password);
});
However no matter what enctype I put in, the username and password is always undefined. What is the error?
P.S Was using body-parser