Document response bodies and MAKE-REDIRECT-RESPONSE.
This commit is contained in:
parent
9dac2674b4
commit
35ca7dabe9
|
@ -232,6 +232,13 @@ constructing responses lives in the \ex{httpd-responses} structure.
|
||||||
represents the body of the response; more on that below.
|
represents the body of the response; more on that below.
|
||||||
\end{desc}
|
\end{desc}
|
||||||
|
|
||||||
|
\defun{make-redirect-response}{location}{response}
|
||||||
|
\begin{desc}
|
||||||
|
This is a helper procedure for constructing HTTP redirections. The
|
||||||
|
server will serve the new file indicated by \var{location}.
|
||||||
|
\var{Location} must be URI-encoded and begin with a slash.
|
||||||
|
\end{desc}
|
||||||
|
|
||||||
\defun{make-error-response}{status-code request [message] extras \ldots}{response}
|
\defun{make-error-response}{status-code request [message] extras \ldots}{response}
|
||||||
\begin{desc}
|
\begin{desc}
|
||||||
This is a helper procedure for constructing error responses.
|
This is a helper procedure for constructing error responses.
|
||||||
|
@ -295,6 +302,33 @@ constructing responses lives in the \ex{httpd-responses} structure.
|
||||||
\ex{status-code-message} extracts its associated default message.
|
\ex{status-code-message} extracts its associated default message.
|
||||||
\end{desc}
|
\end{desc}
|
||||||
|
|
||||||
|
\section{Response Bodies}
|
||||||
|
\label{httpd:response-bodies}
|
||||||
|
|
||||||
|
A \textit{response body} represents the body of an HTTP response.
|
||||||
|
There are several types of response bodies, depending on the
|
||||||
|
requirements on content generation.
|
||||||
|
|
||||||
|
\defun{make-writer-body}{proc}{body}
|
||||||
|
\begin{desc}
|
||||||
|
This constructs a response body from a \textit{writer}---a procedure
|
||||||
|
that prints the page contents to a port. The \var{proc} argument
|
||||||
|
must be a procedure accepting an output port (to which \var{proc}
|
||||||
|
prints the body) and the options value passed to the \ex{httpd}
|
||||||
|
invocation.
|
||||||
|
\end{desc}
|
||||||
|
|
||||||
|
\defun{make-reader-writer-body}{proc}{body}
|
||||||
|
\begin{desc}
|
||||||
|
This constructs a response body from a \textit{reader/writer}---a
|
||||||
|
procedure that prints the page contents to a port, possibly after
|
||||||
|
reading input from the socket of the HTTP connection. The
|
||||||
|
\var{proc} argument must be a procedure accepting three arguments:
|
||||||
|
an input port (associated with the HTTP connection socket), an
|
||||||
|
output port (to which \var{proc} prints the body), and the options
|
||||||
|
value passed to the \ex{httpd} invocation.
|
||||||
|
\end{desc}
|
||||||
|
|
||||||
\section{Request Handlers}
|
\section{Request Handlers}
|
||||||
\label{httpd:request-handlers}
|
\label{httpd:request-handlers}
|
||||||
|
|
||||||
|
@ -500,6 +534,9 @@ Dito, but also serve directory indices for directories without
|
||||||
|
|
||||||
\section{CGI Server}
|
\section{CGI Server}
|
||||||
|
|
||||||
|
The procedure(s) described here live in the \ex{httpd-cgi-handlers}
|
||||||
|
structure.
|
||||||
|
|
||||||
\defun{cgi-handler}{bin-dir [cgi-bin-path]}{request-handler}
|
\defun{cgi-handler}{bin-dir [cgi-bin-path]}{request-handler}
|
||||||
\begin{desc}
|
\begin{desc}
|
||||||
Returns a request handler for CGI scripts located in
|
Returns a request handler for CGI scripts located in
|
||||||
|
|
Loading…
Reference in New Issue