Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Determining Content-Length when there is no Content-Length header

by hacker (Priest)
on Sep 30, 2007 at 00:24 UTC ( #641735=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
       my $req         = HTTP::Request->new(HEAD => $url);   
       my $resp        = $ua->request($req);
       my $type        = $resp->header('Content-Type');
       my $content     = $resp->content;   
       my $content_len = $resp->header('Content-Length');   
    
  2. or download this
       my $req         = HTTP::Request->new(GET => $url); 
       my $content     = $resp->content;
       my $content_len = length($content);
    
  3. or download this
       my $req         = HTTP::Request->new(HEAD => $pl_url);
       my $resp        = $ua->request($req);
    ...
           $content     = $resp->content;  
           $content_len = length($content);
       }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://641735]
Approved by calin
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2017-10-22 16:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (273 votes). Check out past polls.

    Notices?