3

I use REST client apps in chrome to create a request using method POST: It's here:

http://localhost:1337/signup?email=mail@mail.com&password=123123123&password_c=123123123

The results (req.body.email or req.body.password) return undefined when I log them in console What's problem? Here is my order in middleware for http request

 order: [
            'startRequestTimer',
            'cookieParser',
            'session',
            'myRequestLogger',
            'passportInit',
            'passportSession',
            'bodyParser',
            'handleBodyParserError',
            'compress',
            'methodOverride',
            'poweredBy',
            '$custom',
            'router',
            'www',
            'favicon',
            '404',
            '500'
        ],

Thanks all!

BrTkCa
  • 4,703
  • 3
  • 24
  • 45
hhaiit
  • 63
  • 1
  • 5

1 Answers1

1

req.body doesn't have data, your email and password is in your URL. You can have it by using req.params.email.

If this doesn't work, can you post your Controller that handle the route 'POST /signup'?

M-A. Fernandes
  • 530
  • 5
  • 13