1
流星的HTTP package是mikeal的請求包裝,它支持followRedirects
選項。但是,在遵循3xx重定向響應(並且請求沒有fail because of lack of a cookie jar)後,如何找出最終的URL?流星:重定向後的最終位置/網址是什麼?
有了請求,最終的URL在response.request.href
。但是流星......?
這裏的流星代碼:
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
});
}
似乎你的包的鏈接應該是:https://github.com/StockBase/meteor-http-更多 –
@JulienLeCoupanec:正確的GitHub鏈接是https://github.com/dandv/meteor-http -更多 –