Express的五个重点对象
2023-06-27 14:40:22 7 举报
AI智能生成
Express的五个重点对象
作者其他创作
大纲/内容
Response
Properties
res.app
res.headersSent
res.locals
Methods
res.json()
res.redirect()
res.render(view [, locals] [, callback])
res.sendFile(path [, options] [, fn])
res.status(code)
res.download()
res.append (res.append)
使用它来定义服务器响应中的任何标准/非标准头。
res.type (res.type)
这专门用于定义Content-Type标头
Router
Methods
router.all()
router.METHOD()
router.param()
router.route()
router.use()
express()
Methods
express.json()
express.raw()
express.Router()
express.static()
express.text()
express.urlencoded()
Application
Properties
app.locals
app.mountpath
Events
mount
Methods
app.all()
app.delete()
app.disable()
app.disabled()
app.enable()
app.enabled()
app.engine()
app.get()
app.get()
app.listen()
app.METHOD()
app.param()
app.path()
app.post()
app.put()
app.render()
app.route()
app.set()
app.use()
Request
Properties
req.app
req.baseUrl
req.body
req.cookies
req.fresh
req.hostname
req.ip
req.ips
req.method
req.originalUrl
req.params
req.path
req.protocol
req.query
req.route
req.secure
req.signedCookies
req.stale
req.subdomains
req.xhr
Methods
req.accepts()
req.acceptsCharsets()
req.acceptsEncodings()
req.acceptsLanguages()
req.get()
req.is()
req.param()
req.range()
0 条评论
下一页