Common Lisp Package: CLACK.RESPONSE

# Clack.Response - Portable HTTP Response object for Clack response. ## SYNOPSIS (defvar res nil) (setf res (make-response 200)) (setf res (make-response 200 '(:content-type "text/html"))) (setf res (make-response 200 '(:content-type "text/html") '("aiueo"))) ;; Access each fields (status res) ;;=> 200 (headers res) ;;=> (:content-type "text/html") (headers res :content-type) ;;=> "text/html" (body res) ;;=> ("aiueo") ;; Set to each fields (setf (status res) 304) (setf (headers res :content-type) "text/plain") (setf (body res) '("moved")) (setf (body res) "moved") ;; string also allowed ## DESCRIPTION Clack.Response allows you a way to create Clack response. ## AUTHOR * Eitarow Fukamachi (e.arrows@gmail.com)

README:

FUNCTION

Public

MAKE-RESPONSE (&OPTIONAL STATUS HEADERS BODY)

A synonym for (make-instance '<response> ...). Create a <response> instance.

Private

ENSURE-LIST (LIST)

If LIST is a list, it is returned. Otherwise returns the list designated by LIST.

UNIVERSAL-TO-TIMESTAMP (UNIVERSAL &KEY (NSEC 0))

Returns a timestamp corresponding to the given universal time.

URL-ENCODE (STRING &OPTIONAL (EXTERNAL-FORMAT *DEFAULT-EXTERNAL-FORMAT*))

URL-encodes a string using the external format EXTERNAL-FORMAT.

Undocumented

FORMAT-RFC1123-TIMESTRING (DESTINATION TIMESTAMP)

MACRO

Private

DOPLIST ((KEY VAL PLIST &OPTIONAL VALUES) &BODY BODY)

Iterates over elements of PLIST. BODY can be preceded by declarations, and is like a TAGBODY. RETURN may be used to terminate the iteration early. If RETURN is not used, returns VALUES.

GETF* (PLACE KEY)

Similar to `getf' but allows many types for the `key', String, Keyword or Symbol.

GENERIC-FUNCTION

Public

Undocumented

SETFBODY (VALUE RES)

FINALIZE (RES)

HEADERS (RES &OPTIONAL NAME)

SETFHEADERS (VALUE RES &OPTIONAL NAME)

PUSH-HEADER (RES NAME VALUE)

REDIRECT (RES URL &OPTIONAL (STATUS))

SET-COOKIES (RES &OPTIONAL NAME)

SETFSET-COOKIES (VALUE RES &OPTIONAL NAME)

Private

Undocumented

FINALIZE-COOKIES (RES)

SLOT-ACCESSOR

Public

Undocumented

BODY (OBJECT)

STATUS (OBJECT)

SETFSTATUS (NEW-VALUE OBJECT)

CLASS

Public

<RESPONSE>

Portable HTTP Response object for Clack response.