class for WIN-CGI

I have develop a class for Win-CGI but I cannot seem to be able to return the my response to client. Each time I run my program it seems to work but I get the following message in my browser window.

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

I use the IIS 4.0 web server.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

In the CGI interface, you have to build the HTML header by yourself. The design of a HTTP response header is defined in RFC 2068, section 6.2 ( Briefly, a HTTP response header can look like:
(only the text between the lines count, CR+LF and blanks are important !)
HTTP/1.0 200 OK
Server: MyPrivateServer
Content-length: 123
Content-type: text/html

The header ends with 2 CR+LF, then comes the content. Note that the Content-length value should set appropriate.

I forgot, everything in the header is case sensitive.
malalandAuthor Commented:
No good, My server hangs with these lines.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Hi (again) malaland,

could you send a piece of code, at least the response part of the program.

Just a guess:

    WriteLn('Content-type: text/html');
    WriteLn('<TITLE>Hello !</TITLE>');

Something like that should work.

Leave our the line with the "Server:" and "HTTP/1.0" Keywords. It seems that your server is providing these additional header. So, like itamars example, it should read

var MyHTML : string;
  MyHTML := '<HTML><HEAD><TITLE>Hello !</TITLE></HEAD>';
  MyHTML := MyHTML + '<BODY>Hello World</BODY></HTML>';

  WriteLn(Format('Content-length: %d', [Length(MyHTML)]));
  WriteLn('Content-type: text/html');


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
malalandAuthor Commented:
I found a way. Unfortunately it did not have anything to do with what you told me.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.