[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-WebCGI] Re: Document contains no data





>> 2) Mac servers differ from other servers in that they generally don't
>> create _any_ headers for .cgi scripts.  So you really need to return
>> something like:
>>
>> $eol = "\015\012";
>> print "HTTP/1.0 200 OK", $eol, "Server: WebSTAR 4", $eol, "MIME-Version:
>> 1.0", $eol, "Content-type: text/html", $eol, $eol;
>>
>> This contains all the headers neccesary. (You may be able to use HTTP/1.1
>> instead.... read up about the requirements.  Also, change the Server
>> field to be whatever server you're using...)
>
>AFAIK, most Mac web servers generally *do* generate headers for the script.
>Also, if the CGI is saved as a CGI Script file (which it has to be if it 
>is to
>be used on a mac), MacPerl will take care of all of the headers for you. I
>suggest you look at the folder "MacPerl CGI" in the MacPerl folder. In
>particular, look at the code in Demo.cgi.

Hmmmm... perhaps you have a more recent version of the CGI generator....  
the Demo.cgi stuff in my MacPerl CGI folder all generates its own 
headers, and if I don't generate the headers myself from within my 
script, I get a "document contains no data" error....

Do you use CGI.pm?  That would explain it....

>Perl:
>
>print "Hello, World!";
>
>Browser gets(on my server):
>
>HTTP/1.0 200 OK
>Server: QuidProQuo/2.2
>Content-type: text/html
>MIME-Version: 1.0
>
>Hello, World!
>
>[snip more examples showing server generating response headers...]

I tried this a while back on my server (WebStar 3, at the time, but via 
errors have verified with WebStar 4) -- my setup will not generate any 
headers for me.  I actually prefer it this way, as it allows my .cgi to 
generate a 302 (304?) header, which allows me to have a nice close to the 
interaction with my .cgi (a logout feature...)

Ricky Morse

-----
Pukku


==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org