Web
res.send res.render
taenyLog
2023. 6. 28. 07:13
반응형
res.send
The res.send() function basically sends the HTTP response. The body parameter can be a String or a Buffer object or an object or an Array.
Syntax:
res.send( [body] )
Parameter: This function accepts a single parameter body that describes the body which is to be sent in the response.
Returns: It returns an Object.
res.render
The res.render() function is used to render a view and sends the rendered HTML string to the client.
Syntax:
res.render(view [, locals] [, callback])
Parameters: This function accepts two parameters as mentioned above and described below:
Locals: It is basically an object whose properties define local variables for the view.
Callback It is a callback function.
Returns: It returns an Object.
반응형