Tool to view response headers [closed]

2019-01-21 04:26发布

What is the best way to view the HTTP response headers from a request against a particular URL? Telnet or is there some other really good command or tool?

16条回答
贪生不怕死
2楼-- · 2019-01-21 05:02

If you are familiar with the developer tools in your browser, open the network tab on the developer tools, refresh the page, then click on the headers tab. The response headers will be listed. For instance this page sends this header:

HTTP/1.1 200 OK
Cache-Control: public, max-age=60
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Expires: Fri, 01 Mar 2013 02:00:20 GMT
Last-Modified: Fri, 01 Mar 2013 01:59:20 GMT
Vary: *
X-Frame-Options: SAMEORIGIN
Date: Fri, 01 Mar 2013 01:59:19 GMT
Content-Length: 13555
查看更多
你好瞎i
3楼-- · 2019-01-21 05:04

There is a better choice (in my point of view)

It's a Firefox extension calle HTTPfox. You can not only see the header but much more information. It´s a very complete HTTP analyzer

https://addons.mozilla.org/en-US/firefox/addon/6647

查看更多
孤傲高冷的网名
4楼-- · 2019-01-21 05:05

Using a recent version of Firefox (19.0 in my case), going to menu Tools -> Web Developer -> Web Console (Ctrl + Shift + K on Windows) then refreshing the page produces a log of requests.

Then clicking on one of the first GET requests, the one with the URL of the page, opens a box with information about it, including request and response headers. It works out of the box, no need for fancy-shmancy add-ons any more.

查看更多
我命由我不由天
5楼-- · 2019-01-21 05:09

If you aren't looking to do it on your machine, you can use any number of online applications that do it for you.

  1. Rex Swain's HTTP viewer
  2. http://web-sniffer.net/: This one is a bit more flexible with regard to the app layer protocol (HTTP/S)
  3. Ask Apache: This one lets you customize your request a lot more.
查看更多
淡お忘
6楼-- · 2019-01-21 05:15

On Linux I use:

wget -S [url] 

This gets the file and shows all headers sent by the server.

On Windows one can use the same command if Cygwin is installed; either on regular command prompt, if the environment variables were properly adjusted, or through the Cygwin command window.

查看更多
爷的心禁止访问
7楼-- · 2019-01-21 05:15

The Firebug addon for Firefox is the easiest way I think.

查看更多
登录 后发表回答