Each HTTP requests is represented using a
(see ws-request). The request object serves two purposes, one
internal and one external. Internally, request objects are used to
hold state while HTTP headers are parsed incrementally as the HTTP
request text is received from the network. Externally, request
objects are used to decide which handler to call, and are then passed
as the only argument to the called handler.
In addition to fields used internally, each
holds the network process in the
process and holds all HTTP
headers and request GET or POST parameters in the
alist. HTML Headers are keyed using uppercase keywords (e.g.,
:GET), and user supplied parameters are keyed using the string
name of the parameter.
process field may be used by handlers to send data to a
client as in the following example.
(process-send-string (process request) "hello world")
headers field may be used to access request information
such as the requested path,
(cdr (assoc :GET (headers request)))
or named parameters as from a web form.
(cdr (assoc "message" (headers request)))