|Delphi Clinic||C++Builder Gate||Training & Consultancy||Delphi Notes Weblog||Dr.Bob's Webshop|
Apache DSO and Post with Kylix 1.0
People have been asking me to explain why in Kylix 1.0, the Request.ContentFields.Values['variable_name'] is not returning the variable value from a form when they try this from an Apache DSO (while it works very well using an Apache CGI application).
The explanation, as also mention in my WebBroker chapters of Kylix Developer's Guide is as follows: There is a bug in the shipping version of Kylix 1.0 Server Developer when using POST in combination with a DSO web server application. The problem is that the Request.ContentFields will remain empty, even if information was posted. The Request.Content does have a value, it's just that this value is not broken into individual ContentFields.
An unofficial fix, provided by Shane Hausle of Borland, involves adding one line of code to the file ApacheHTTP.pas (but first you need to make a backup of this file - just in case). In this unit, find the TApacheResponse.GetStringVariable function, and add the following case after '15:'
16: Result := ap_table_get(FRequest_rec^.headers_in,'Content-Length');Now, copy the ApacheHTTP.pas to the lib directory (you may also want to add it to your project explicitly) and when you compile it also compile the fixed ApacheHTTP.pas file and produce new .dcu files that fix the above problem.
Note that this problem is fixed in Kylix 2, so you don't have to worry if you're using WebBroker with Kylix 2.