In Node.js and Express, the ________ method is used to send a JSON response to the client.

  • res.JSON()
  • res.json()
  • res.sendAsJSON()
  • res.sendJSON()
In Node.js and Express, the res.json() method is used to send a JSON response to the client. It serializes a JavaScript object into JSON format and sends it as the HTTP response, allowing for structured data interchange between the server and client.
Add your answer
Loading...

Leave a comment

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