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.
Loading...
Related Quiz
- You are tasked with ensuring secure communication between microservices in a distributed system. How can JWT be used to ensure that the calls between microservices are authorized?
- Imagine you are tasked with ensuring that an API complies with GDPR regulations. What steps would you take?
- What is meant by "statelessness" in the context of Web APIs?
- Which common vulnerability involves unauthorized commands being sent to a database via an API?
- Why is performance testing important for APIs?