Express - POST processing - undefined?

Tell us what’s happening:

Repl here is not processing the POST name data. I tried to console.log it and got an error, Cannot read property string of undefined But for adding urlParser, I am using the same function I used for the GET challenge slightly earlier, which it passed.

Your code so far

var bodyParser = require('body-parser');

var urlParser = bodyParser.urlencoded({extended: false});

  .get((req, res) => {
      name: req.query.first + ' ' + req.query.last
  .post(urlParser, (req, res) => {
      name: req.query.first + ' ' + req.query.last

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0.

Challenge: Get Data from POST Requests

Link to the challenge:


It works for me. Maybe you didn’t call it correctly:

This is a picture of a plugin for Firefox called RESTer:

But when I try to input names using the HTML form, I get errors and undefined? (That and it doesn’t pass FCC automatic testing.)

Oh! I see now. Use req.body instead of req.query.