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)?