res.send() do in Express?res.send() sends a response back to the client. It can send strings, objects, or buffers as the HTTP response body.
res.send() send JSON objects directly?Yes, if you pass an object to res.send(), Express converts it to JSON and sets the Content-Type header to application/json.
res.send() multiple times in one request?Only the first call to res.send() sends the response. Subsequent calls are ignored or cause errors because the response is already sent.
res.send() differ from res.json()?res.send() can send any type of response (string, buffer, object), while res.json() specifically sends JSON and sets the Content-Type header to application/json.
res.send() to send a text response?app.get('/hello', (req, res) => {
res.send('Hello, friend!');
});This sends the text 'Hello, friend!' to the browser.
res.send() send in Express?res.send() can send strings, objects (which it converts to JSON), and buffers as responses.
res.send(), what does Express do?Express automatically converts objects to JSON and sets the correct header.
res.send() twice in the same route handler?Once the response is sent, you cannot send another one for the same request.
res.json() is designed specifically to send JSON responses.
res.send()?Express sets the Content-Type header to application/json when sending objects.
res.send() works in Express and what types of data it can send.res.send() and res.json() in Express.