扫码关注官方订阅号
fetch("img.png",{ mode:"cros" }).then(response=>{ console.log(response.headers);//打印为空! });
chrome.f12 network能看到headers数据的。
走同样的路,发现不同的人生
那是个Header对象啊
得这样
fetch("img.png",{ mode:"cros" }).then(response => { console.log(response.headers.get('Content-Type')); });
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
那是个Header对象啊
得这样