wget using HEAD call with server response

You can perform only the HEAD call using the wget tool from your linux box. You'll require to use the --spider parameter from the tool. For example the below command,

wget --spider http://icfun.blogspot.com/

This will display the below output after HEAD on the url.

--15:06:47-- http://icfun.blogspot.com/
Resolving icfun.blogspot.com... 74.125.127.132
Connecting to icfun.blogspot.com|74.125.127.132|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/html]
200 OK


Now, if you want to see the full http response for your HEAD call, you can combined the command --server-response with that. For example the below command,

wget --spider http://icfun.blogspot.com/ --server-response

This will display you the below output, where you'll have the required all http headers that came as server response from that site.


--15:07:37-- http://icfun.blogspot.com/
Resolving icfun.blogspot.com... 74.125.127.132
Connecting to icfun.blogspot.com|74.125.127.132|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.0 200 OK
Content-Type: text/html; charset=UTF-8
Expires: Thu, 18 Nov 2010 15:07:38 GMT
Date: Thu, 18 Nov 2010 15:07:38 GMT
Cache-Control: public, max-age=0, must-revalidate, proxy-revalidate
Last-Modified: Thu, 18 Nov 2010 15:06:18 GMT
ETag: "b0fd7a2a-8612-4b5a-a39a-41ad17059db6"
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Length: 0
Server: GSE
Connection: Keep-Alive
Length: 0 [text/html]
200 OK

Comments