Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

class for WIN-CGI

Posted on 1998-03-26
6
Medium Priority
?
229 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 300 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

618 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