Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the json-responses Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed Jun 15 04:53:22 2022 GMT+0.
Next: Systems, Previous: The json-responses Reference Manual, Up: The json-responses Reference Manual [Contents][Index]
This library provides a standard set of JSON responses for Hunchentoot applications. It's been tested on SBCL, CCL, CLISP, and LispWorks but should work anywhere that Hunchentoot and CL-JSON do. If it doesn't work on your Lisp of choice open an issue and I'll investigate.
Best enjoyed with Quicklisp:
(ql:quickload 'json-responses)
Or, to run the included test suite:
(ql:quickload 'json-responses)
(ql:quickload 'json-responses-test)
One generic function (json-response) can accept :status, :headers, :data, and :error keyword arguments:
(json-response :status +http-ok+
:headers '(("X-HELLO" . "world"))
:data "Hello, world!"
:error "Not applicable here, but for demonstration...")
Which would respond with a 200 status code, an X-HELLO header with the value world, a content-type of application/json, and a JSON body like:
{
"data": "Hello, world!",
"error": "Not applicable here, but for demonstration..."
}
All keyword arguments are optional and have sane defaults. If both data and error are omitted then the body is simply null.
The remaining functions can accept :headers, :data, and :error keyword arguments and have status preset to an appropriate value. :data and :headers default to nil, :error defaults to nil for 100, 200, and 300-level responses and a simple error message for 400 and 500-level responses.
The following functions are included:
Next: Files, Previous: Introduction, Up: The json-responses Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Canned JSON responses for Hunchentoot
Brad Melanson <bradmelanson@icloud.com>
MIT
Next: Packages, Previous: Systems, Up: The json-responses Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: json-responses/package.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
json-responses (system).
Next: json-responses/json-responses.lisp, Previous: json-responses/json-responses.asd, Up: Lisp [Contents][Index]
json-responses (system).
Previous: json-responses/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
json-responses (system).
Next: Definitions, Previous: Files, Up: The json-responses Reference Manual [Contents][Index]
Packages are listed by definition order.
json-responses
Next: Indexes, Previous: Packages, Up: The json-responses Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Previous: Public Interface, Up: Public Interface [Contents][Index]
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Ordinary functions, Previous: Internals, Up: Internals [Contents][Index]
Previous: Definitions, Up: The json-responses Reference Manual [Contents][Index]
Jump to: | A B C D E F G H I J L M N O P R S T U |
---|
Jump to: | A B C D E F G H I J L M N O P R S T U |
---|
Jump to: | C F J P S |
---|
Jump to: | C F J P S |
---|