I am trying to send an Object as part of httprequest. The values are populated from Specflow table.
public class Request
{
public Dictionary<string, dynamic> RequestParameters =
new Dictionary<string, dynamic>();
public void setRequestParameters(Table table)
{
foreach (var row in table.Rows)
{
try
{
RequestParameters.Add(row[0], row[1]);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
Request request = new Request();
request.setRequestParameters(table);
var result = client.PostAsJsonAsync<Request>(_address.ToString(), request).Result;
The value is sent however I don't want the memberName(RequestParameters) enclosing the values. Is there a way to ignore it?
{
"RequestParameters":{
"InitialCashAmount":"10000.00",
"TransferAmount":"5000.00",
"PersonalRegularContribution":"100.00"
}
}