Have this :
HttpContent requestContent = Request.Content;
string jsonContent = requestContent.ReadAsStringAsync().Result;
then in this jsonContent :
ID=1234&toName=&fromId=49gjgijl7a4in
I am trying to parse in model :
Model model = JsonConvert.DeserializeObject<Model>(jsonContent);
But it throws an exception :
Error parsing boolean value. Path '', line 0, position 0
Any idea ?
Edit :
My client side logic :
var client = new HttpClient();
var values = new Dictionary<string, string>()
{
{"toId", obj.toId},
{"toName", obj.toName},
{"fromId", obj.fromId},
};
var content = new FormUrlEncodedContent(values);
var response = await client.PostAsync(apiUrl, content);
response.EnsureSuccessStatusCode();