From: Edward S. <ed...@gm...> - 2009-01-08 23:35:26
|
2009/1/9 Edward Stow <ed...@gm...>: > Hi > > I am trying to use json strings to communicate between my browser and > yaws server. > > Is this the correct documentation for the json in yaws. It does not > match what I am seeing from the yaws command line: > > http://hg.opensource.lshift.net/erlang-rfc4627/raw-file/tip/doc/index.html > > Using Yaws 1.77 on Ubuntu 8.10 > > Using the documentation from above: > 3> json:encode({obj, []}). > ** exception exit: {json_encode,{bad_term,{obj,[]}}} > in function json:encode/1 > > But this works as described in the Yaws json rpc man page. > > 4> json:encode({struct, []}). > [123,[],125] > > 5> lists:flatten(json:encode({struct, []})). > "{}" > > 6> json:decode(lists:flatten(json:encode({struct, []}))). > ** exception error: undefined function json:decode/1 > Bad form but just found json:decode_string/1 after extensive googling 7> json:decode_string(lists:flatten(json:encode({struct, []}))). {ok,{struct,[]}} Clearly I don't have access to the full documentation: Can somebody give me a reference to the doc. Thanks -- Edward Stow |