我正在尝试将Json对象从一个控制器(一个)传递到另一个控制器(两个):
{
"t": "abc",
"r": '0',
"o": "",
"n": "",
"v": "1",
"k": "1.0",
}
在控制器2中我想收到这些数据:
[HttpPost]
public JObject AllReceivedData(Jobject objData)
{
}
如何将Json对象从控制器1发送到控制器2?
答案 0 :(得分:0)
终于明白了。
//Get Data in Json Format
client.Headers[HttpRequestHeader.ContentType] = "application/json";
//Sent the Request to URL and Fetch the Data in Bytes
var result = client.UploadData("URL", Encoding.UTF8.GetBytes(request));
//Convert into dynamic object to get Json format
dynamic obj = JObject.Parse(Encoding.UTF8.GetString(result).ToString());
//DeserializeObject the "obj" Object in Any Model.