3 ms·
> Especially for debugging caching and whatnot, using curl -D - -o /dev/null http://example.net/ http://example.net/ makes it extremely simple to see the header
by prakashk 17y ago
> Especially for debugging caching and whatnot, using curl -D - -o /dev/null http://example.net/ http://example.net/ makes it extremely simple to see the headers the server is sending for a certain file.
Working on web stuff, I'd needed to see server headers many times, and I have always used the HEAD command, that is part of the libwww-perl package on ubuntu. It's just: HEAD http://example.com http://example.com.
The libwww-perl package also comes with GET (which is similar to curl in that it sends the retrieved content to standard output) and POST (which sends a POST request to a server) commands which are very handy too.
- danudey 17y agoFor that, I usually use 'curl -I http://example.com/ http://example.com/, in case you don't want to install a separate package (or, for some reason, dislike perl).