Clack.Request - Portable HTTP Request object for Clack Request.
SYNOPSIS
(defun app (env)
(let ((req (make-request env)))
`(200
(:content-type "text/plain")
("Hello, " (query-parameter req "name")))))
DESCRIPTION
Clack.Request provides a consistent API for request objects.
AUTHOR
- Eitarow Fukamachi (e.arrows@gmail.com)
EXTERNAL SYMBOLS
-
Class: <request> inherits (standard-object)
Portable HTTP Request object for Clack Request.
- env Reader: env
- Raw env
- request-method Reader: request-method
- The HTTP request method.
This must be one of :GET, :HEAD, :OPTIONS, :PUT, :POST, or :DELETE.
- script-name Reader: script-name
- The initial portion of the request URL's path, corresponding to the application.
This may be an empty string if the application corresponds to the server's root URI. If this key is not empty, it must start with a forward slash (/).
- path-info Reader: path-info
- The remainder of the request URL's path.
This may be an empty string if the request URL targets the application root and does not have a trailing slash.
- server-name Reader: server-name
- The resolved server name, or the server IP address.
- server-port Reader: server-port
- The port on which the request is being handled.
- server-protocol Reader: server-protocol
- The version of the protocol the client used to send the request.
Typically this will be something like :HTTP/1.0 or :HTTP/1.1.
- request-uri Reader: request-uri
- The request URI. Must start with '/'.
- uri-scheme Reader: uri-scheme
- remote-addr Reader: remote-addr
- remote-port Reader: remote-port
- query-string Reader: query-string
- The portion of the request URL that follows the '?', if any.
- raw-body Reader: raw-body
- content-length Reader: content-length
- content-type Reader: content-type
- clack-handler Reader: clack-handler
- http-referer Reader: referer
- http-user-agent Reader: user-agent
- http-cookie
- body-parameters
- query-parameters
-
Method: initialize-instance
[(this <request>) &rest env]
-
Function: shared-raw-body
[env]
Returns a shared raw-body, or returns nil if raw-body is
empty. This function modifies REQ to share raw-body among the
instances of .
-
Function: make-request
[env]
A synonym for (make-instance ' ...).
Make a instance from environment plist. Raw-body of the instance
will be shared, meaning making an instance of doesn't effect
on an original raw-body.
-
Method: securep
[(req <request>)]
-
Method: cookies
[(req <request>) &optional name]
Returns cookies as a plist. If optional `name` is specified, returns the value that corresponds to it.
-
Method: body-parameter
[(req <request>) &optional name]
Return POST parameters as a plist. If optional `name` is specified, returns the value that corresponds to it.
-
Method: query-parameter
[(req <request>) &optional name]
Returns GET parameters as a plist. If optional `name` is specified, returns the value that corresponds to it.
-
Method: parameter
[(req <request>) &optional name]
Returns request parameters containing (merged) GET and POST parameters. If optional `name` is specified, returns the value that corresponds to it.