public List<Paquete> GetPaquete() { url = url + codigo + clave + keyAPI + keyPaso; RestClient client = new RestClient(url); RestRequest request = new RestRequest(url, Method.Get); request.RequestFormat = DataFormat.Json; request.AddHeader("Context-Type", "application/json"); var response = client.Execute(request); if (response.IsSuccessful) { var listadof = JsonConvert.DeserializeObject<List<Paquete>>(url); var peso = listadof[0]; return listadof; } else { var error = response.ErrorMessage; } return null; }
[Serializable] public class Paquete { [JsonProperty("peso")] public string peso { get; set; } [JsonProperty("trackingnumber")] public string trackingNumber { get; set; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)