C# 在post参数c中添加数组#
我想在我的post参数中添加如下内容C# 在post参数c中添加数组#,c#,arrays,asp.net,dictionary,C#,Arrays,Asp.net,Dictionary,我想在我的post参数中添加如下内容 {"DaysBefore": 5, "IdList": [ 5, 9, 13, 14 ], "pId": 1, "mId": 1 } 我有一本这样的字典 var postData = new Dictionary<string, string>(); postData.Add("IdList","b") var postD
{"DaysBefore": 5,
"IdList": [
5,
9,
13,
14
],
"pId": 1,
"mId": 1
}
我有一本这样的字典
var postData = new Dictionary<string, string>();
postData.Add("IdList","b")
var postData=newdictionary();
添加(“IdList”、“b”)
我怎样才能加上b呢[
5.
9,
13,
14
]在那里
我想使用c#将Generic.List发送到后端,看起来您需要发布一个JSON对象;您应该使用JSON序列化程序而不是字典。