API for json
- ()
by Stuart Sierra
Full namespace name:
clojure.contrib.json
Overview
JavaScript Object Notation (JSON) parser/writer.
See http://www.json.org/
To write JSON, use json-str, write-json, or write-json.
To read JSON, use read-json.
Public Variables and Functions
json-str
function
Usage: (json-str x & options)
Converts x to a JSON-formatted string.
Source
pprint-json
function
Usage: (pprint-json x & options)
Pretty-prints JSON representation of x to *out*
Source
print-json
function
Usage: (print-json x & options)
Write JSON-formatted output to *out*
Source
read-json
function
Usage: (read-json input)
(read-json input keywordize?)
(read-json input keywordize? eof-error? eof-value)
Reads one JSON value from input String or Reader.
If keywordize? is true (default), object keys will be converted to
keywords. If eof-error? is true (default), empty input will throw
an EOFException; if false EOF will return eof-value.
Source
read-json-from
function
Usage: (read-json-from input keywordize? eof-error? eof-value)
Reads one JSON value from input String or Reader.
If keywordize? is true, object keys will be converted to keywords.
If eof-error? is true, empty input will throw an EOFException; if
false EOF will return eof-value.
write-json
function
Usage: (write-json object out escape-unicode?)
Print object to PrintWriter out as JSON