【发布时间】:2017-01-27 12:46:46
【问题描述】:
我需要编写 JSON 字符串并将其发送到 Web 服务。 我必须按如下方式创建 JSON
{
"SALES": [
{
"INDEX_NX": 1,
"Audios": [
{
"Name": "audio_file",
"Content": "string_base64",
"Extension": "WAV",
"Id": "1236585"
}
],
"Documents": [
{
"Name": "proposal_based",
"Content": "string_base64",
"Extension": "PNG",
"Type_document": "PROPOSAL SIGNED"
},
{
"Name": "document_with_photo",
"Content": "string_base64",
"Extension": "PNG",
"Document_type": "CNH"
}
]
}
]
}
如何使用 newntonsoft 类做到这一点?
【问题讨论】:
-
从技术上讲,这不是有效的 json - 您可能不小心剪掉了尾随
]}。否则,您需要一些类似的类来存储数据。我不知道“尝试过”是什么意思