In my code i send a post to rest service such as:
var response = await client.PostAsJsonAsync(requesturi, mydata);
mydata collection is translated to Json by PostAsJsonAsyn as:
{
"queryid" : "GetNames",
"@StartDate" : "1/1/2019",
"@EndDate" : " "2/1/2019"
}
However the server return Http 400 reponse unless the jason object is wrapped in brackets (tested in Postman)
[
{
"queryid" : "GetNames",
"@StartDate" : "1/1/2019",
"@EndDate" : " "2/1/2019"
}
]
Is there any way to add the brackets to json object passed by PostAsJasonAsyn method
Thanks