【发布时间】:2014-05-29 19:43:44
【问题描述】:
Meteor 的 HTTP package 是 mikeal 请求的包装器,它支持 followRedirects 选项。但是,在遵循 3xx 重定向响应(并且请求没有 fail because of lack of a cookie jar)之后,如何找出最终 URL 是什么?
通过请求,最终 URL 为 response.request.href。但是使用 Meteor...?
这是流星代码:
if (Meteor.isServer) {
Meteor.startup(function () {
var url = 'http://google.com';
var result = HTTP.call("HEAD", url, {
followRedirects: true
});
console.log(result); // nothing here hints at the final URL
});
}
【问题讨论】:
标签: javascript meteor http-redirect