[Lazarus] Is CGIApp compatible with methods PUT and DELETE?

Michael Van Canneyt michael at freepascal.org
Mon Dec 26 20:52:35 CET 2011



On Mon, 26 Dec 2011, silvioprog wrote:

> Hi,
>
> I'm tried with two differents projects. I'm sending both projects to
> test in attached.
>
> When I try execute "http://localhost/cgi-bin/rest" with PUT (or
> DELETE) method, the response of server is:
>
> HTTP/1.1 500 Internal Server Error
> Date: Mon, 26 Dec 2011 18:25:20 GMT
> Server: Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8
> mod_perl/2.0.4 Perl/v5.10.1
> Vary: accept-language,accept-charset
> Accept-Ranges: bytes
> Connection: close
> Content-Type: text/html; charset=iso-8859-1
> Content-Language: en
> Expires: Mon, 26 Dec 2011 18:25:20 GMT
>
> But if I build a CGI project with WriteLn work fine. :/ Eg.
>
> program rest;
>
> uses
>  SysUtils;
>
> begin
>  WriteLn('Content-Type: text/plain');
>  WriteLn;
>  WriteLn(GetEnvironmentVariable('REQUEST_METHOD'));
> end.
>
> So, is CGIApp compatible with methods PUT and DELETE?

Currently not. When a request arrives, the fcl-web code 
tries to initialize the request variables.

The problem is that the InitRequestVars can only initialize the 
request variables for GET and POST. I can of course skip 
initialization if the method is not one of those.

It's easily fixable, the main problem is that for PUT and DELETE, 
I do not know how to initialize the request variables, I have not 
found any description of how to do this.

Michael.




More information about the Lazarus mailing list