Response codes other than 200 OK

D

Don

I'm trying to use HTTP::Response to create a response when my perl cgi
program is run.

I keep getting "malformed header" errors:
.... malformed header from script. Bad header=HTTP/1.1 304 (Not Modified)

I set all the headers and possible content then finally issue
print $r->as_string();

Where $r is my HTTP::Response item.

So I can see exactly what is sent, I also use sendmail to send that
exact thing as an e-mail message.

%mailmsg = (
...
Message => "---\n" . $r-> as_string() . "---\n",
);
sendmail %mailmsg;

and this is what I get in e-mail.... looks OK to me.

---
HTTP/1.1 304 (Not Modified)
Connection: close
Date: Mon, 13 Mar 2006 16:11:49 GMT
Expires: Mon, 10 Apr 2006 16:11:49 GMT


---

How can I return various HTTP result codes to clients? Not everything is
"200 OK" simple.

I've tried including content-type: headers too, with no affect.
All I can find on google is to print the content-type header first,
followed by a blank line... that woul just make all MY headers part of
the response BODY... the clien would see a 200 OK status code. :-(

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top