HTTP协议规定: Clients SHOULD NOT include a Referer header field in a (non-secure) HTTP request if the referring page was transferred with a secure protocol. 解决办法: 1.表单添加一个字段referrer,如果头部没有Referer,则获取表单的这个字段, 添加js: <input id="referrer" type=&
以下为js获取HTTP的全部请求头信息: var req = new XMLHttpRequest(); req.open('GET', document.location, false); req.send(null); var headers = req.getAllResponseHeaders().toLowerCase(); console.log(headers); 以下为js获取HTTP的部分请求头信息,如日期: var req = new XMLHttpRequest(); re