本文共 889 字,大约阅读时间需要 2 分钟。
在邮件标头中找到无效的字符
You can access all the HTTP headers using the Request.headers
property:
您可以使用Request.headers
属性访问所有HTTP标头:
app.get('/', (req, res) => { console.log(req.headers)})
Use the Request.header()
method to access one individual request header’s value:
使用Request.header()
方法访问一个单独的请求标头的值:
app.get('/', (req, res) => { req.header('User-Agent')})
You can change any HTTP header value using Response.set()
:
您可以使用Response.set()
更改任何HTTP标头值:
res.set('Content-Type', 'text/html')
There is a shortcut for the Content-Type header, however:
但是,Content-Type标头有一个快捷方式:
res.type('.html')// => 'text/html'res.type('html')// => 'text/html'res.type('json')// => 'application/json'res.type('application/json')// => 'application/json'res.type('png')// => image/png:
翻译自:
在邮件标头中找到无效的字符
转载地址:http://mvqgb.baihongyu.com/