0
假设我想获得一些页面,当服务器获得我的请求时,它会重定向我几次。如何在使用请求时检测这些重定向?如果可能的话,我希望看到完整的重定向路径。节点js请求模块 - 如何跟踪重定向?
另外我注意到,当我访问一些页面 - 我从somepage.com/blah重定向到somepage.com,状态是200?怎么样?
假设我想获得一些页面,当服务器获得我的请求时,它会重定向我几次。如何在使用请求时检测这些重定向?如果可能的话,我希望看到完整的重定向路径。节点js请求模块 - 如何跟踪重定向?
另外我注意到,当我访问一些页面 - 我从somepage.com/blah重定向到somepage.com,状态是200?怎么样?
感谢还有https://github.com/olalonde/follow-redirectcts和https://github.com/jksolbakken/linkfollower。但是,是不是只有命令的要求? – webmasternewbie
不客气,如果你只想要重定向/请求的网址,那么只需使用console.log(request.url); ,但我仍然建议摩根,因为它更全面 –
By response.request.uri.href我只得到最新的(最终)重定向。我想知道所有的重定向(如:mypage.com/test - > mypage.com/test2 - > mypage.com/test3) – webmasternewbie