Add documentatin for PARSE-HTML-FORMS.

This commit is contained in:
sperber 2003-01-22 10:41:16 +00:00
parent f8487a2158
commit bf0d37476a
1 changed files with 21 additions and 0 deletions

View File

@ -622,6 +622,27 @@ that following procedure cause an error if called:
\ex{eval-safely} returns \sharpf.
\end{defundesc}
\section{Writing Request Handlers}
\subsection{Parsing HTML Forms}
In HTML forms, field data are turned into a single string, of the form
\texttt{\synvar{name}=\synvar{val}\&\synvar{name}=\synvar{val}\ldots}.
The \ex{parse-html-forms} structure provides simple functionality to
parse these strings.
\defun{parse-html-form-query}{string}{alist}
\begin{desc}
This parses \verb|"foo=x&bar=y"| into \verb|(("foo" . "x") ("bar" .
"y"))|. Substrings are plus-decoded (i.-e.\ plus characters are
turned into spaces) and then URI-decoded.
This implementation is
slightly sleazy as it will successfully parse a string like
\verb|"a&b=c&d=f"| into \verb|(("a&b" . "c") ("d" . "f"))| without
a complaint.
\end{desc}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "man"