我正在使用urllib向网页发出请求,我正试图返回它的标题,如下所示:
var getHeaders = function(webpage){ var info = urllib.request(webpage, {}, function(err, data, res){ // console.log(res.headers); works fine and shows them return res.headers; // I thought it should make the info variable have the headers information }); return info; }
现在,当我试图获取可能set-cookie
是网页的标题时,我打算从网站返回该标题,但它没有,那么有没有办法返回标题或是不可能这样做?