Help me with my problem i try get data from web API for method post, but always show null.
public class ShippingQuantity
{
public string QuantityLoad { get; set; }
public string QuantityLoaded { get; set; }
public string QuantityPendingLoad { get; set; }
public string ElementInfo { get; set; }
public Guid kElement { get; set; }
public string LineNumber { get; set; }
}
public class ShippingQuantityData
{
public List<ShippingQuantity> shippingData { get; set; }
public string message { get; set; }
}
and it its my code
using (var client = new HttpClient())
{
client.BaseAddress = new Uri(Baseurl);
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage Res = await client.PostAsync(urlService, formContent);
if (Res.IsSuccessStatusCode)
{
var Response = Res.Content.ReadAsStringAsync().Result;
data = JsonConvert.DeserializeObject<ShippingQuantityData>(Response);
}
when execute for mode debug the variable Response show it
"{
\"data\": [
{
\"QuantityLoad\": \"5\",
\"QuantityLoaded\": \"1\",
\"QuantityPendingLoad\": \"4\",
\"ElementInfo\": \"2147-PIZZA 6 UNIDADES\",
\"kElement\": \"8fa2ec91-2b20-415c-a65d-11c13d6725fd\",
\"LineNumber\": \"1\"
}
],
\"Message\": \"\"
}"
thanks