Chapter 5

Writing CGI Scripts in Scheme

The cgi-scripts structure provides functionality useful for writing CGI scripts in Scheme.

(cgi-form-query)     --->     data-alist         (procedure) 
CGI scripts receive their parameters in various ways, depending on how they were called (e.g. by GET method).

This procedure translates the delivered form data into an alist of decoded strings, using the environment variables set by the server (REQUEST_METHOD, QUERY_STRING (for a GET request), CONTENT_LENGTH (for a POST request)). So a query string like

button=on&reply=Oh,%20yes
becomes an alist
(("button" . "on") ("reply" . "Oh, yes"))

Cgi-form-query only works for GET and POST methods.