Solved

class for WIN-CGI

Posted on 1998-03-26
6
225 Views
Last Modified: 2010-04-06
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.
0
Comment
Question by:malaland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:d003303
ID: 1360923
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 (ftp://ftp.leo.org/pub/comp/doc/standards/rfc/rfc-2000-2099/rfc2068). 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.

Slash/d003303
0
 
LVL 4

Expert Comment

by:d003303
ID: 1360924
I forgot, everything in the header is case sensitive.
0
 

Author Comment

by:malaland
ID: 1360925
No good, My server hangs with these lines.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:itamar
ID: 1360926
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;
    WriteLn('<HTML>');
    WriteLn('<HEAD>');
    WriteLn('<TITLE>Hello !</TITLE>');
    WriteLn('</HEAD>');
    WriteLn('<BODY>');

Something like that should work.

Bye,
Itamar
0
 
LVL 4

Accepted Solution

by:
d003303 earned 150 total points
ID: 1360927
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;
begin
  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');
  WriteLn;
  Write(MyHTML);
end;

Slash/d003303
0
 

Author Comment

by:malaland
ID: 1360928
I found a way. Unfortunately it did not have anything to do with what you told me.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi - replicating a form 8 93
Moving (cutting/pasting) controls in a TTabbedNotebook... 7 48
delphi popmenu non latine charcters 3 35
IP without any Dots 1 59
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question