Module mochijson2
Yet another JSON (RFC 4627) library for Erlang.
Copyright � 2007 Mochi Media, Inc.
Authors: Bob Ippolito (bob@mochimedia.com ).
Description
Yet another JSON (RFC 4627) library for Erlang. mochijson2 works with binaries as strings, arrays as lists (without an {array, _}) wrapper and it only knows how to decode UTF-8 (and ASCII).
Data Types
iodata()
iodata() = iolist() | binary()
iolist()
iolist() = [char() | binary() | iolist() ]
json_array()
json_array() = [json_term() ]
json_number()
json_number() = integer() | float()
json_object()
json_object() = {struct, [{json_string() , json_term() }]}
json_string()
json_string() = atom | binary()
json_term()
json_term() = json_string() | json_number() | json_array() | json_object()
Function Index
decode/1 | Decode the given iolist to Erlang terms. |
decoder/1 | Create a decoder/1 with the given options. |
encode/1 | Encode the given as JSON to an iolist. |
encoder/1 | Create an encoder/1 with the given options. |
test/0 |
Function Details
decode/1
decode(S::iolist() ) -> json_term()
Decode the given iolist to Erlang terms.
decoder/1
decoder(Options::[decoder_option() ]) -> function()
Create a decoder/1 with the given options.
encode/1
encode(Any::json_term() ) -> iolist()
Encode the given as JSON to an iolist.
encoder/1
encoder(Options::[encoder_option() ]) -> function()
Create an encoder/1 with the given options.
test/0
test() -> any()
转自: http://www.erlware.org/lib/5.6.3/mochiweb-0.83/mochijson2.html#type-json_number