2006-06-30

wget察看web server header

有时为了调试需要察看web server返回的header,可以在firefox下使用如live http header这样的工具。手边要是没有这样的工具,可以用wget的两个选项来实现:


-S
--server-response
Print the headers sent by HTTP servers and responses sent by FTP servers.


--spider
When invoked with this option, Wget will behave as a Web spider, which means that it will not download the pages, just check that they are there. For example, you can use Wget to check your book-marks:
wget --spider --force-html -i bookmarks.html


比如:
wget -S --spider http://www.uni-trier.de
另外可以用
wget -q -O - http://www.industrial-technology-and-witchcraft.de/index.php/ITW/itw-rss20/ | head -1
来得到xml文件的第一行声明:
< ?xml version="1.0" encoding="iso-8859-1"?>

没有评论:

发表评论