http://www.perlmonks.org?node_id=1006926

Doctrin has asked for the wisdom of the Perl Monks concerning the following question:

Hello everyone! Is there a module that just kicks the URL given, and DOES NOT get the contents placed there? All I need to know is response code. I was about to send HEAD request, but I'm not sure if the remote server process such kind of requests... So, the idea is to send a GET request, but retreive only response status (or all headers). Thanx in advance
  • Comment on A Perl module like LWP::UserAgent that gets just response headers, not body, avoiding HEAD request?

Replies are listed 'Best First'.
Re: A Perl module like LWP::UserAgent that gets just response headers, not body, avoiding HEAD request?
by rjt (Curate) on Dec 03, 2012 at 19:38 UTC

    All conforming servers must respond to a HEAD request, so $ua->head($url, ...) is the correct call with a LWP::UserAgent object. A GET request will get the entire page.

    What are you trying to do? What have you tried, and what happened (or didn't happen, but was supposed to) when you tried it? Please see How do I post a question effectively?.

Re: A Perl module like LWP::UserAgent that gets just response headers, not body, avoiding HEAD request?
by Anonymous Monk on Dec 03, 2012 at 19:34 UTC