Mixed results with CGI
Richard Gaskin
ambassador at fourthworld.com
Sun Aug 25 06:32:01 EDT 2002
Dave Cragg wrote:
> At 2:33 am -0700 25/8/02, Richard Gaskin wrote:
>>> To check if the problem is at the client or server end, you should
>>> check the result of the post statement.
>>>
>>> post tData to url "http://www.fourthworld.net/cgi-bin/t.mt"
>>> if the result is empty then
>>> put it into fld "r"
>>> else
>>> answer the result
>>> end if
>>>
>>> Also, to test if data is getting read in at the server end, you could
>>> add a line like this.
>>>
>>> read from stdin until empty
>>> put it into buffer
>>> put "EXTRA DATA" before buffer
>>> put "Content-Type: text/plain" & cr
>>> put "Content-Length:" && the length of buffer & cr & cr
>>> put buffer
>>>
>>
>> Did that. It seems to be on the client side. All server data comes back as
>> expected, but the length of the data coming in from the cliebt is usually 0
>> (it works about 5% of the time, at seemingly random intervals).
>
> To check the headers in the response (and particularly the
> Content-Length header) try calling the libUrlLastRhHeaders()
> function after the post statement. Something like:
>
> post tData to url "http://www.fourthworld.net/cgi-bin/t.mt"
> if the result is empty then
> put it into fld "r"
> answer libUrlLastRhHeaders()
> else
> answer the result
> end if
Here's the result:
HTTP/1.1 200 OK
Date: Sun, 25 Aug 2002 10:17:28 GMT
Server: Apache/1.3.26 (Unix) FrontPage/5.0.2.2510
Content-Length: 71
Content-Type: text/html
The content is 71 chars as I have some hard-wired test data coming back. If
the data passed in was coming back it's be about 1500 chars.
> PS Which OS, and is the server on the client's localhost?
Client: Mac OS 9.2.2
Server: FreeBSD 3.x.
Apache 1.3.3
CGI/1.1 interface
--
Richard Gaskin
Fourth World Media Corporation
Custom Software and Web Development for All Major Platforms
Developer of WebMerge 2.0: Publish any Database on Any Site
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
More information about the metacard
mailing list