What is the difference between node's bodyParser and express's urlencoded middleware? What is the difference between node's bodyParser and express's urlencoded middleware? express express

What is the difference between node's bodyParser and express's urlencoded middleware?


so why should i use body-parser (which i have to install separatly) instead of always using express.urlencoded()

For the simple reason that it was not available in older version of express

This middleware is available in Express v4.16.0 onwards.

If you're using the latest version, there's almost no reason to.

body-parser provides a few additional utilities like bodyParser.raw([options]) or bodyParser.text([options]) which almost nobody uses (never seen use one myself).