我正在尝试使用 RestSharp 向我的实体发送请求。
但是我收到一个错误:
"System.Xml.XmlException : The '`' character, hexadecimal value 0x60,
cannot be included in a name."
我将列表放在查询的正文中。
var strList = new List<string>();
strList.Add("one");
strList.Add("two");
restRequest.AddBody(strList);
它似乎不喜欢泛型的序列化方式。 对于如何将列表传递给请求有什么建议吗?
最佳答案
添加: restRequest.RequestFormat = DataFormat.Json 之前: restRequest.AddBody(strList);
关于c# - 发送列表时的 '`'字符和RestSharp请求体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18332471/