博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在邮件标头中找到无效的字符_在Express中使用HTTP标头
阅读量:2522 次
发布时间:2019-05-11

本文共 889 字,大约阅读时间需要 2 分钟。

在邮件标头中找到无效的字符

从请求访问HTTP标头值 (Access HTTP headers values from a request)

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')})

更改响应的任何HTTP标头值 (Change any HTTP header value for a response)

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/

你可能感兴趣的文章
51nod 1197 字符串的数量 V2(矩阵快速幂+数论?)
查看>>
OKMX6Q在ltib生成的rootfs基础上制作带QT库的根文件系统
查看>>
zabbix
查看>>
多线程基础
查看>>
完美解决 error C2220: warning treated as error - no ‘object’ file generated
查看>>
使用SQL*PLUS,构建完美excel或html输出
查看>>
SQL Server数据库笔记
查看>>
X-Forwarded-For伪造及防御
查看>>
android系统平台显示驱动开发简要:LCD驱动调试篇『四』
查看>>
Android 高仿微信头像截取 打造不一样的自定义控件
查看>>
Jenkins的初级应用(1)-Publish Over SSH
查看>>
利用正则表达式群发定制邮件
查看>>
【原】RDD专题
查看>>
第三周——构建一个简单的Linux系统MenuOS
查看>>
Docker 的两类存储资源 - 每天5分钟玩转 Docker 容器技术(38)
查看>>
Codeforces 257D
查看>>
常用的20个强大的 Sublime Text 插件
查看>>
ajaxfileupload.js在IE中的支持问题
查看>>
tensorflow学习之(十)使用卷积神经网络(CNN)分类手写数字0-9
查看>>
当document.write里含有script标签时
查看>>