My problem is that I cannot extract an object sent by an API, despite I have the schema of the object either in the API or in the client. My code:
public async Task<ActionResult> Index()
{
HttpClient client = new HttpClient();
Uri baseAddress = new Uri("http://localhost:44237/");
client.BaseAddress = baseAddress;
HttpResponseMessage response = client.GetAsync("api/Front/Subm?IdSubmission=1xxx").Result;
try
{
if (response.IsSuccessStatusCode)
{
string Result = await response.Content.ReadAsStringAsync();
JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
Submission sub = JsonConvert.DeserializeObject<Submission>(Result);
return View(sub);
}
else
{
}
}
catch (Exception e)
{
}
}
structure received in result is