如何轻松测试HTTP返回码,比如说301重定向?如何测试HTTP 301重定向?
例如,如果我想 “看看这是怎么回事”,我可以用的telnet做这样的事情:
... $ 远程登录nytimes.com 80
Trying 199.239.136.200...
Connected to nytimes.com.
Escape character is '^]'.
GET/HTTP/1.0
(输入)
(输入)
HTTP/1.1 200 OK
Server: Sun-ONE-Web-Server/6.1
Date: Mon, 14 Jun 2010 12:18:04 GMT
Content-type: text/html
Set-cookie: RMID=007af83f42dd4c161dfcce7d; expires=Tuesday, 14-Jun-2011 12:18:04 GMT; path=/; domain=.nytimes.com
Set-cookie: adxcs=-; path=/; domain=.nytimes.com
Set-cookie: adxcs=-; path=/; domain=.nytimes.com
Set-cookie: adxcs=-; path=/; domain=.nytimes.com
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Cache-control: no-cache
Pragma: no-cache
Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
...
这是一个简单的方法来访问颇有些相关信息。
但现在我想测试301重定向确实是301重定向。
我该怎么做?
基本上,而不是得到一个HTTP/1.1 200好我想知道我怎么能得到301?
我知道我可以在浏览器中输入网址的名称,并“看到”我被重定向了,但我想知道什么工具可以用来真正“看到” 301重定向。
顺便说一句,我做了一个telnet测试,但是当我输入www.example.org,我重定向到example.org(没有www),我只能看到一个“200 OK”,我不喜欢看不到301.
这不适用于Windows 7 – Krunal 2012-09-07 05:46:48