PublicShow sourcehttp_cgi.pl -- Run CGI scripts from the SWI-Prolog web-server

Run CGI scripts. This module provides two interfaces:

See also
- http://hoohoo.ncsa.uiuc.edu/cgi/env.html
To be done
- complete environment translation. See env/3.
- testing. Notably for POST and PUT commands.
http_cgi_handler(+Alias, +Request)
Locate a CGI script in the file-search-path Alias from the path_info in Request and execute the script using http_run_cgi/2. This library installs one handler using:
:- http_handler(root('cgi-bin'), http_run_cgi(cgi_bin),
                [prefix, spawn([])]).
http_run_cgi(+Script, +Options, +Request) is det
Execute the given CGI script. Options processed:
argv(+List)
Argument vector to give to the CGI script. Defaults to no arguments.
transfer_encoding(Encoding)
Emit a Transfer-encoding header
buffer(+Buffer)
Set buffering of the CGI output stream. Typically used together with transfer_encoding(chunked).
Parameters:
Script- specifies the location of the script as a specification for absolute_file_name/3.
Request- holds the current HTTP request passed from the HTTP handler.