js获取HTTP的请求头信息
时间:2019-01-23 20:17:48
收藏:0
阅读:1310
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
评论(0)