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

Constructing HTTP Headers ...

David Gartner
December 4, 2001 14:49
Constructing HTTP Headers ...
Message ID:
Hello all...

Before I start, please reply to or 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:


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

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? Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About