标签:lan net 添加 har tail lag referer 特性 replace
原因参考这篇
http://blog.csdn.net/sylvilagus/article/details/50233335
postman是基于浏览器的插件,发出的请求都是通过调用ajax/xmlhttprequest
的方式,必然受到浏览器的安全限制:
具体哪些header不能set,要看XMLHttpRequest.js
的源码实现
var forbiddenRequestHeaders = [
"accept-charset",
"accept-encoding",
"access-control-request-headers",
"access-control-request-method",
"connection",
"content-length",
"content-transfer-encoding",
"cookie",
"cookie2",
"date",
"expect",
"host",
"keep-alive",
"origin",
"referer",
"te",
"trailer",
"transfer-encoding",
"upgrade",
"via" ];
经验证,以上属性在postman中设置全部无效。解决方案是打开postman的拦截器(interceptor),之后就可以正常添加cookie了。
标签:lan net 添加 har tail lag referer 特性 replace
原文地址:http://www.cnblogs.com/qooweds/p/7211973.html