public async Task <FlightFares> GetFlightFaresAsync(string path) { FlightFares fares = null; HttpResponseMessage response = await hTTPClient.GetAsync(path); if (response.IsSuccessStatusCode) { fares = await response.Content.ReadAsAsync <FlightFares>(); } return(fares); }
public async Task <FlightFares> GetFlightFares(FindFlightsFare s) { string queryString = RequestContext.Url.Request.RequestUri.Query; string decoded = HttpUtility.UrlDecode(queryString); decoded = decoded.Substring(3); FindFlightsFare result = JsonConvert.DeserializeObject <FindFlightsFare>(decoded); string path = "/v2/shop/flights/fares?origin=" + result.origin + "&destination=" + result.destination + "&lengthofstay=" + result.lengthofstay + "&departuredate=" + result.departuredate + "&minfare=" + result.minfare + "&maxfare=" + result.maxfare + "&pointofsalecountry=" + result.pointofsalecountry; FlightFares flightFares = null; using (RestClient restClient = new RestClient()) { flightFares = await restClient.GetFlightFaresAsync(path); } return(flightFares); }