Getting Date from http header response

前端 未结 4 589
既然无缘
既然无缘 2021-01-12 09:17

Okay so I can access the HTTP ajax response header using

xhr.getAllResponseHeaders();

but it doesn\'t seem to get the Date with it, though

4条回答
  •  孤城傲影
    2021-01-12 09:51

    This Helped :

    var req = new XMLHttpRequest();
    req.open('GET', document.location, false);
    req.send(null);
    var headers = req.getAllResponseHeaders().toLowerCase();
    alert(headers);
    

    Accessing the web page's HTTP Headers in JavaScript

提交回复
热议问题