我试图传递以下参数到请求体,但它不工作。
{
"Start": 0,
"Limit": 10,
"SysID": 632;
"ResultScope": "Enrolled",
"SearchParams":
[
{"Field":"ID", "Weight": 1, "Value": ["1234567"], "Operation": "Active", "Enabled": true}
]
}
我尝试了什么。
var test = request.AddBody(new Search { Start = 0, Limit = 10, SysId = 632, ResultScope = "Enrolled", SearchParams = new List<Object> { "ID", 1, 1234567, "Active”, "true" } });
但没有成功。当我试图在seralization后将其作为Addobject添加到请求中时,我得到了目标参数异常。
您可能想阅读 文献.
request.AddJsonBody(
new Search {
Start = 0,
Limit = 10,
SysId = 632,
ResultScope = "Enrolled",
SearchParams = new List<Object> { "ID", 1, 1234567, "Active”, "true" }
});
var response = await client.GetAsync<WhateverYouWantBack>(request);