
http_cgi.pl -- Run CGI scripts from the SWI-Prolog web-server
Run CGI scripts. This module provides two interfaces:
- http_run_cgi/2 can be used to call a CGI script located exernally. This is typically used for an individual script used to extend the server functionality.
- Setup a path
cgi_binfor absolute_file_name/3. If this path is present, calls to /cgi-bin/... are translated into calling the script.
- http_cgi_handler(+Alias, +Request)
- Locate a CGI script in the file-search-path Alias from the
path_infoin 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-encodingheader - buffer(+Buffer)
- Set buffering of the CGI output stream. Typically used together with transfer_encoding(chunked).