473,385 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Response codes other than 200 OK

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,
Mar 13 '06 #1
0 3204

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: TinyTim | last post by:
I'm a newbie at ASP & HTML. It seems that when you use server side code and you're going to return a customized HTML form with several fields and labels, you have to do an extensive amount of...
2
by: Michael | last post by:
I have to do a data migration for a client. The following conversion is required. Task: - MOVEMENT table with 7,000,000 records, each has a location code - Location code has changed; I have a...
9
by: Rick Cook | last post by:
I would like to do a response form on one of my sites instead of posting an e-mail address for spammers. I've taken a couple of examples from sites, but the code looks clunky and non-conformant to...
4
by: Paul T. RONG | last post by:
Dear All, I add two new tables to the database and then the disable shift key codes don't work. These two new tables are actually created by two queries, and only these two are in the front end,...
6
by: DotNetGruven | last post by:
I've got a page that does a search... There is an ImageButton on it that allows the user to reset the search. The Click Handler for the button clears out the Data and then redirects to the same...
11
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as...
3
by: Jocelyn Duhaylungsod | last post by:
I have been getting the following server errors sporadically while downloading excel, csv or xml file. Internet Explorer cannot download <file name> from <IP address> "The server returned an...
1
by: csgraham74 | last post by:
i have the following code Response.AddHeader("content-disposition", "attachment; filename=" & str_AccountNo & ".pdf") Response.ContentType = "application/pdf"...
4
by: Bart op de grote markt | last post by:
Hello I have a website in php in which I have some kind of portal to external links that come from a database. When a user clicks on a link, "link.php" is called, does some stuff (e.g. adds 1...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.