Mixed results with CGI

Dave Cragg dcragg at lacscentre.co.uk
Sun Aug 25 06:05:00 EDT 2002


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

PS Which OS, and is the server on the client's localhost?

Cheers
Dave



More information about the metacard mailing list