I need to JSON-encode a list using mochiweb.
How do I get the following:
List = ["This is message 1.", "This is message 2.", "This is the last message"]
mochijson2:encode({struct,[{messages,list_to_binary(List)}]
to produce this bit of JSON:
{"messages":"["This is message 1.","This is message 2.","This is the last message"]}