我正在将JSON发送到服务器。
客户: 我清理了一个xml文档(删除了根和名称空间),所以我有以下xml:
<Node1>
<StaffFirstName>xxxxx</StaffFirstName>
<StaffLastName>Lxxxxx</StaffLastName>
</Node1>
var content = new StringContent(JsonConvert.SerializeXmlNode(xmlDocument).ToString(), Encoding.UTF8, "application/json");
var response = client.PostAsync(url, content).Result;
服务器:
public Node Post([FromBody]dynamic value)
{
if (value != null)
JObject jSonReceived = (JObject)value;
}
值获取以下JSON
{"Node1":{ "StaffFirstName":"xxxxx", "StaffLastName":"Lxxxxx" }}
jSonReceived 正在显示其他花括号:
{{"Node1":{ "StaffFirstName":"xxxxx", "StaffLastName":"Lxxxxx" }}}
如何删除根大括号?