public async Task <IEnumerable <StopTimes> > GetStationTiming(string url, StopCodeId stopObj) { var serializerSettings = new JsonSerializerSettings(); serializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); string json = JsonConvert.SerializeObject(stopObj, serializerSettings); StringContent queryString = new StringContent(json, Encoding.UTF8, "application/json"); var response = await this.Client.PostAsync(BaseEndpoint + url, queryString); response.EnsureSuccessStatusCode(); var result = await response.Content.ReadAsAsync <IEnumerable <StopTimes> >(); return(result); }
public async Task <IEnumerable <StopTimes> > StopTimes([FromBody] StopCodeId obj) { return(await _trafficService.GetStationTiming("/v1/timing", obj)); }