Which of the following is the correct way to parse JSON in the body of a request in Express.js?

  • app.use(express.json())
  • app.use(body.parse())
  • app.use(request.json())
  • app.parse(json)
To parse JSON in the body of a request in Express.js, you should use app.use(express.json()). This middleware is used to parse JSON data in the request body. The other options do not represent the correct way to parse JSON in Express.js.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *