Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Streaming data through web server to browser with CGI

by rashley (Scribe)
on Aug 16, 2007 at 15:29 UTC ( [id://633086]=note: print w/replies, xml ) Need Help??


in reply to Streaming data through web server to browser with CGI

A monk directed me to LWP::UserAgent. So here's where I am.
my $ua = LWP::UserAgent->new; $ua->timeout(30); my $response = $ua->get($redirectURL); if ($response->is_success) { $logger->info("Grabbing data and passing it to browser."); print $response->content; # or whatever $logger->info($response->content); } else { $logger->info("Didn't get the data."); die $response->status_line; }
I'm seeing the "Grabbing data and passing it to browser." message, and the data in the browser looks like the PDF data I want, but I'm getting an Internal Server Error on the browser.

Thoughts?

Replies are listed 'Best First'.
Re^2: Streaming data through web server to browser with CGI
by moritz (Cardinal) on Aug 16, 2007 at 15:32 UTC
    What's the corresponding message in your webserver's error.log?
      "Premature end of script headers"
        Did you print out a content-type header before your program prints anything else (including warnings)?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://633086]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2026-01-15 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.