Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do a HTTP HEAD request from the windows command line? [closed]

What's the best way (or tool) on the Windows (Vista) command line to get size and modification time for a file on a remote webserver, without downloading it?

like image 503
Henning Avatar asked Oct 20 '08 10:10

Henning


3 Answers

There is a Win32 port of wget that works decently.

PowerShell's Invoke-WebRequest -Method Head would work as well.

like image 88
Tomalak Avatar answered Nov 10 '22 13:11

Tomalak


If you cannot install aditional applications, then you can telnet (you will need to install this feature for your windows 7 by following this) the remote server:

TELNET server_name 80

followed by:

HEAD /virtual/directory/file.ext

or

GET /virtual/directory/file.ext

depending on if you want just the header (HEAD) or the full contents (GET)

like image 10
Laurence Avatar answered Nov 10 '22 11:11

Laurence


On Linux, I often use curl with the --head parameter. It is available for several operating systems, including Windows.

[edit] related to the answer below, gknw.net is currently down as of February 23 2012. Check curl.haxx.se for updated info.

like image 9
CesarB Avatar answered Nov 10 '22 11:11

CesarB