Solved

class for WIN-CGI

Posted on 1998-03-26
6
221 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

862 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now