Re: Problem with Content-Type

Marc Langheinrich (marclang@cs.washington.edu)
Tue, 14 Jul 1998 18:43:00 +0900


>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.

Well, that's because images aren't of Content-type "text/html" afterall. :-)
Try to use the content-type that came in the response:

if($res->is_success) {
print $res->content_type, "\n\n";  # See HTTP::Message manpage
print $res->content;
}

If you don't know the content type of a file, you can also look into
LWP::MediaTypes...


marc