public static Task <ObservableCollection <CargoInfoModel> > InserOrUpdateCargo(CargoInfoModel cargo) { var Client = new RestClient("http://39.104.103.234:8081/api/Cargos/InsertOrUpdateCargo") { Timeout = -1 }; var Request = new RestRequest(Method.POST); Request.AddHeader("Content-Type", "application/json"); Request.AddParameter("application/json", JsonConvert.SerializeObject(cargo), ParameterType.RequestBody); var Response = Client.Execute(Request); return(Task.FromResult(JsonConvert.DeserializeObject <ObservableCollection <CargoInfoModel> >(Response.Content))); }