Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: How to read request headers?

by grep (Monsignor)
on Jul 19, 2008 at 23:34 UTC ( #698861=note: print w/replies, xml ) Need Help??

in reply to How to read request headers?

It would be much easier if you posted some code (preferably a small test case). I have no idea if you are using CGI, CGI::Lite, or any other CGI modules.

That being said one way to see the Content-Range header would be to use %ENV to pull the 'HTTP_CONTENT_RANGE'.


Here is a test CGI script:

use warnings; use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use Data::Dumper; my $q = CGI->new; print $q->header,$q->start_html; print '<pre>'; print Dumper \%ENV; print '</pre>'; print "<br>Content-Range: ",$ENV{HTTP_CONTENT_RANGE};

And a small fake request:

use warnings; use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => ''); $req->header( 'Content-Range' => 'bytes 0-499/500' ); my $resp = $ua->request($req); print $resp->{_content};
One dead unjugged rabbit fish later...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://698861]
[karlgoethebier]: Rap rhymes to crap. Ouch!
[karlgoethebier]: Unne hip unne hop unne schoppe inne kopp...
[1nickt]: kgb not quite as simple as ... and ...; are interchangeable. There are edge cases, shown in perlsyn.
[1nickt]: Hm well actually I guess it's not the trailing semi-colon that's at issue there, it's disambiguation between the ellipsis and the binary flip-flop

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2017-11-18 19:38 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (277 votes). Check out past polls.