Problem with Content-Type

Michael Slater (mikey@iexpress.net.au)
Tue, 14 Jul 1998 14:50:28 +0800 (WST)


Hi 
   i am trying to write a short CGI script to process http GET requests,
and it works ok, but it has a hard time getting the right MIME type.. i.e
images dont display, but the .html files display properly.

sub display_request {
$ua = new LWP::UserAgent;
#$ua->env_proxy;
$ua->agent("Mozilla/5.0 " . $ua->agent);
$ua->proxy('http','http://proxy.domain.com:3128/');
my $req = new HTTP::Request GET =>"http://$request";
$req->content('match=www&errors=0');
my $res = $ua->request($req);
if($res->is_success) {
 print "Content-Type: text/html\n\n";

The above line does not seem to work correctly, as images and other types
dont display properly.

 print $res->content;
} else {
  print "Not Found\n";
}
}

Any ideas ?

Michael