http请求头部信息的获取方法:
let req = new XMLHttpRequest(); req.open(‘GET‘, document.location, false); req.send(null); console.log(req) let content=req.getResponseHeader(‘content-type‘)console.log(content)
var headers = req.getAllResponseHeaders().toLowerCase(); console.log(headers);
参考链接:https://www.bbsmax.com/A/WpdK0OrzVQ/
原文地址:https://www.cnblogs.com/zjingjing/p/10311125.html
时间: 2024-10-28 15:58:01