sunet/doc/latex/cgi-script.tex

25 lines
878 B
TeX
Raw Normal View History

2003-01-22 05:47:22 -05:00
\chapter{Writing CGI Scripts in Scheme}\label{cha:cgi-scripts}
%
2003-01-22 05:47:22 -05:00
The \ex{cgi-scripts} structure provides functionality useful for
writing CGI scripts in Scheme.
2003-01-22 05:47:22 -05:00
\defun{cgi-form-query}{}{data-alist}
\begin{desc}
CGI scripts receive their parameters in various ways, depending on
2003-01-22 05:47:22 -05:00
how they were called (e.g.\ by \ex{GET} method).
This procedure translates the delivered form data into an alist of
decoded strings, using the environment variables set by the server
(\ex{REQUEST\_METHOD}, \ex{QUERY\_STRING} (for a \ex{GET} request),
\ex{CONTENT\_LENGTH} (for a \ex{POST} request)). So a query string
like \codex{button=on\&\ob{}reply=Oh,\ob{}\%20yes} becomes an alist
2003-01-22 05:48:46 -05:00
\codex{(("button" . "on") ("reply" . "Oh, yes"))}
2003-01-22 05:47:22 -05:00
\ex{Cgi-form-query} only works for \ex{GET} and \ex{POST} methods.
\end{desc}
2003-01-22 05:47:22 -05:00
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "man"
%%% End: