In this small article, I am going to show you the Difference between req params req body and req query in Nodejs
How req.params works
req.params get the data from the segment of the url where the route name starts with
" : ". For eg:
Now the required code to get the value of
req.params.movieid = 5896544
How req.body works?
req.body properties come from a form post or body section where the form data has been parsed into properties.
How req.query works?
req.query comes from query parameters in the URL such as
req.query.name === "boss".
Hope you are now clear between the key difference between request-params, request-body and request-query.