develooper Front page | perl.libwww | Postings from April 2001

Re: LWP Header Information Only

Thread Previous
From:
John Stracke
Date:
April 6, 2001 11:28
Subject:
Re: LWP Header Information Only
Message ID:
3ACE0C62.C8FA99AB@ecal.com
"I....AM.....I" wrote:

> --- "Paul Maine Jr." <paulm@msicc.com> skrev: > How
> can I modify the following code to only print
> > header information?
>
> >
> >   $req = HTTP::Request->new(GET =>
> > 'http://www.anycompany.com/');
>
>     print $res->as_string
>
> whill print the request header ....

If you just want the header, you should use HEAD instead of
GET--it's more polite to the server.  Doing GET and then throwing
away the body is wasteful.

--
/================================================================\
|John Stracke    | http://www.ecal.com |My opinions are my own.  |
|Chief Scientist |===============================================|
|eCal Corp.      |The cheapest, fastest, most reliable components|
|francis@ecal.com|of a computer system are those that aren't     |
|                |there.--Gordon Bell                            |
\================================================================/




Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About