Perl's libwww comes with a tool called lwp-request, which is installed with symlinks GET, HEAD, etc. You can use GET and have it show only the HTTP headers. Or can you?
The response message I am looking for is this:
HTTP/1.0 200 OK Server: PasteWSGIServer/0.5 Python/2.4.3 Date: Tue, 19 Dec 2006 22:42:20 GMT content-type: text/html; charset=UTF-8 Connection: closeThe response I get using
GET -sed is:
200 OK Connection: close Date: Tue, 19 Dec 2006 22:43:16 GMT Server: PasteWSGIServer/0.5 Python/2.4.3 Content-Type: text/html; charset=UTF-8 Client-Date: Tue, 19 Dec 2006 22:43:16 GMT Client-Peer: 127.0.0.1:5000 Client-Response-Num: 1 Link: </css/style.css>; media="all"; rel="stylesheet"; type="text/css" Link: </css/tabs.css>; media="all"; rel="stylesheet"; type="text/css" Link: </css/tabs-ie.css>; media="all"; rel="stylesheet"; type="text/css" Title: pimp: music for you.What? LWP appears to be doing some html parsing. :(
So, a solution usiung netcat, which is trash, because lwp should just not be stupid by default. All I want are http headers. Here's my netcat solution:
% echo "GET / HTTP/1.0\r\n\r\n" | nc localhost 5000 | col | sed -e '/^$/q' HTTP/1.0 200 OK Server: PasteWSGIServer/0.5 Python/2.4.3 Date: Tue, 19 Dec 2006 23:00:12 GMT content-type: text/html; charset=UTF-8 Connection: closeOh look! The headers I wanted. I hate you, LWP.
Sigh.