Solved

class for WIN-CGI

Posted on 1998-03-26
6
219 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
Comment Utility
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
Comment Utility
I forgot, everything in the header is case sensitive.
0
 

Author Comment

by:malaland
Comment Utility
No good, My server hangs with these lines.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 4

Expert Comment

by:itamar
Comment Utility
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
Comment Utility
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
Comment Utility
I found a way. Unfortunately it did not have anything to do with what you told me.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

8 Experts available now in Live!

Get 1:1 Help Now