你的位置:首页 > 软件开发 > Java > Express4.x常用API(一):res

Express4.x常用API(一):res

发布时间:2016-03-21 12:00:06
最近在学习NodeJS,用到了express,看着官网上的API手册,打算把其中比较常用到的API根据自己理解翻译一下,方便自己学习使用.该篇打算用来记录下express中res.由于水平有限,希望能得到大家的修改,在学习过程中我会持续更新修改Propertiesres.app ...

最近在学习NodeJS,用到了express,看着官网上的API手册,打算把其中比较常用到的API根据自己理解翻译一下,方便自己学习使用.

该篇打算用来记录下express中res.

由于水平有限,希望能得到大家的修改,在学习过程中我会持续更新修改

  • Properties
  • res.app
  • res.headersSent
  • res.locals
  • Methods
  • res.append()
  • res.cookie()
  • res.clearCookie()
  • res.download()
  • res.end()
  • res.format()
  • res.get()
  • res.json()
  • res.jsonp()
  • res.links()
  • res.location()
  • res.redirect()
  • res.render()
  • res.send()
  • res.sendFile()
  • res.sendStatus()
  • res.set()
  • res.status()
  • res.type()
  • res.vary()

 

Response

res对象表示的是Express收到了HTTP请求时的应答.

虽然经常写作res,但是其实你可以自己自由的在回调函数中去定义它

 

1 app.get('/',function(req,res){//第二个参数res就是Response2   res.send("!");3 })

原标题:Express4.x常用API(一):res

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录