"Paul Maine Jr." <[EMAIL PROTECTED]> writes:

> The following code works fine for returning header information for all web
> sites I run it against except for one. The one unusual web site I run this
> against returns the web document but does not print out any header
> information. What could explain no header information?

Either the server simply does not return any headers or they violate
the HTTP protocol somehow so that LWP get confused.  Which server is
it that it fails for?

http://www.anycompany.com/???

Regards,
Gisle


> ****************************************************************************
> *****************************
> use LWP::UserAgent;
> 
>   $ua = LWP::UserAgent->new;
> 
>   #$ua->agent("$0/0.1 " . $ua->agent);
> 
> 
>   $ua->agent("Mozilla/8.0"); # pretend we are very capable browser
> 
>   $req = HTTP::Request->new(GET => 'http://www.anycompany.com/');
> 
>   $req->header('Accept' => 'text/html');
> 
>   # send request
> 
>   $res = $ua->request($req);
> 
>   # check the outcome
> 
>   if ($res->is_success) {
>      print $ua->request($req)->as_string;
>   } else {
> 
>      print "Error: " . $res->status_line . "\n";
> 
>   }

Reply via email to