How to get “HTTP_REFERER” with NodeJS?

自作多情 提交于 2020-11-30 02:34:05

问题


A way to get HTTP_REFERER , We can use document.referrer in browser side javascript . But how can we get it in NodeJS ?


回答1:


You can get it by...

req.headers.referer

in...

var http = require('http');
server = http.createServer(function(req, res){
...
}


来源:https://stackoverflow.com/questions/10579994/how-to-get-http-referer-with-nodejs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!