develooper Front page | perl.libwww | Postings from December 2001

Constructing HTTP Headers ...

From:
David Gartner
Date:
December 4, 2001 14:49
Subject:
Constructing HTTP Headers ...
Message ID:
3C0D437D.8030104@rmh.com
Hello all...

Before I start, please reply to dgartner@rmh.com or 
dgartner@foundationtechnologies.net as I am not on the list.

I'm having trouble making simple headers with "just perl".  Here's what 
I'm *trying* to do:  The user authenticates through mod_auth_mysql, then 
the use clicks a link that reads "logout" which runs the following cgi:

(logout.cgi)

print "Content-Type: text/html; HTTP/1.0 401 Unauthorized; 
WWW-authenticate: Basic realm =\"blah\"\n\n";
print <<STOP_HERE;
<html>\n
<head><title>Logged out</title></head>\n
You are logged out.
</body></html>\n
STOP_HERE

This doesn't work (needless to say).  I've tried everything I know with 
perl (which isn't much).  I've talked to a few people and they said I 
needed to look into using LWP::UserAgent.  I've never used it, but more 
than one person directed me towards this.  My questions are: (1) Is this 
what I need to make HTTP Headers? and (2) is so, where do I need to go 
to learn how to do this kinda stuff?




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About