API for json
- ()
by Stuart Sierra
Usage:
(ns your-namespace
(:require 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)
Converts x to a JSON-formatted string.
Source
pprint-json
function
Usage: (pprint-json x)
Pretty-prints JSON representation of x to *out*
Source
print-json
function
Usage: (print-json x)
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)
Print object to PrintWriter out as JSON