Response
app.get('/', function (req, res) {
console.dir(res.headersSent) //false
res.send('OK')
console.dir(res.headersSent) //true
})
#Attribute
:- | :- |
---|---|
res.app |
# |
res.headersSent |
# |
res.locals |
# |
#Method
:- | :- |
---|---|
res.append() |
# |
res.attachment() |
# |
res.cookie() |
# |
res.clearCookie() |
# |
res.download() |
Prompt for files to download # |
res.end() |
end the response process # |
res.format() |
# |
res.get() |
# |
res.json() |
Send JSON response # |
res.jsonp() |
Send a response with JSONP support # |
res.links() |
# |
res.location() |
# |
res.redirect() |
Redirect request # |
res.render() |
render view template # |
res.send() |
Send various types of responses # |
res.sendFile() |
Send a file as an octet stream # |
res.sendStatus() |
# |
res.set() |
# |
res.status() |
# |
res.type() |
# |
res.vary() |
# |
Comments
Related