Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

A Perl module like LWP::UserAgent that gets just response headers, not body, avoiding HEAD request?

by Doctrin (Beadle)
on Dec 03, 2012 at 18:45 UTC ( #1006926=perlquestion: print w/ replies, xml ) Need Help??
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?
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
Re: A Perl module like LWP::UserAgent that gets just response headers, not body, avoiding HEAD request?
by rjt (Deacon) 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?.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1006926]
Approved by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2014-08-01 04:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls