我需要使用 mochiweb 对列表进行 JSON 编码。
我如何获得以下信息:
List = ["This is message 1.", "This is message 2.", "This is the last message"]
mochijson2:encode({struct,[{messages,list_to_binary(List)}]
生成这一点 JSON:
{"messages":"["This is message 1.","This is message 2.","This is the last message"]}