It would be a good idea to learn a little about how HTTP works since you'll need to set the headers yourself. The official spec is at but is a better place to start to get a high level overview.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of John Rusling
Sent: Friday, August 29, 2008 1:43 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: CGIDEV2 - Apache - Premature end of script headers error message.

Thanks Matt.

And the reason (apparently?) is unknown to me in this early juncture
Of my rpg web programming endeavors - BUT -

I switched it to be a standalone call to the rpg (cgi) pgm and
I added an updhtmlvar() line ahead of the first write, it started
working. It wasn't a variable that existed in the template, but that
didn't seem to matter.

John B

date: Thu, 28 Aug 2008 13:36:09 -0400
from: "Haas, Matt (CL Tech Sv)" <matt.haas@xxxxxxxxxxx>
subject: RE: CGIDEV2 - Apache - Premature end of script headers error

You are not writing out the proper HTTP headers (if you look in your
access log, you'll see a 500 level error). You need to return at least

content-type: text/html
<blank line>

"<blank line>" is just a line with a CR and LF and the end.

This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].