我遇到了一个错误:
我该如何发布嵌套字典或数组?
当我使用严重程度状态码 描述 项目 文件 行号 抑制状态 错误 CS1503 第1个参数:无法从'
System.Collections.Generic.Dictionary<string, System.Collections.Generic.Dictionary<string, string>>
'转换为'System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>
HttpClient
提交嵌套字典时。var arg_employee = new Dictionary<string, Dictionary<string, string>>
{
{
"filter_data",
new Dictionary<string, string>
{
{"user_name", "admin"},
}
},
};
var content = new FormUrlEncodedContent(arg_employee);
// ... Use HttpClient.
using (HttpClient client = new HttpClient())
using (HttpResponseMessage response = await client.PostAsync(uRL, content))
using (HttpContent responseContent = response.Content)
{
// ... Read the string.
return await responseContent.ReadAsStringAsync();
我该如何发布嵌套字典或数组?