public async Task <TollsCostResponse> SendGpsTracesRequestAsync(TollsGpsTracesRequest req) { HttpResponseMessage response = _client.PostAsync($"{BaseAddress}/search/tolling/gps_trace?access_key={Key}", new StringContent( JsonConvert.SerializeObject(req), Encoding.UTF8, "application/json")).Result; return(JsonConvert.DeserializeObject <TollsCostResponse>(response.Content.ReadAsStringAsync().Result)); }
public void GpsTracesWithSampleRequest() { TollsGpsTracesRequest request = JsonConvert.DeserializeObject <TollsGpsTracesRequest>( "{ \"locations\": [ { \"timestamp\": \"2017-07-28T17:39:00.000Z\", \"lat\": 47.28348, \"lng\": -122.56066 }, { \"timestamp\": \"2017-07-28T17:39:30.000Z\", \"lat\": 47.28154, \"lng\": -122.56069 }, { \"timestamp\": \"2017-07-28T17:40:00.000Z\", \"lat\": 47.28000, \"lng\": -122.56075 }, { \"timestamp\": \"2017-07-28T17:40:30.000Z\", \"lat\": 47.27901, \"lng\": -122.56081 }, { \"timestamp\": \"2017-07-28T17:41:00.000Z\", \"lat\": 47.27900, \"lng\": -122.56081 }, { \"timestamp\": \"2017-07-28T17:41:30.000Z\", \"lat\": 47.27831, \"lng\": -122.56082 }, { \"timestamp\": \"2017-07-28T17:42:00.000Z\", \"lat\": 47.27823, \"lng\": -122.56082 }, { \"timestamp\": \"2017-07-28T17:42:30.000Z\", \"lat\": 47.27798, \"lng\": -122.56082 } ], \"vehicle\": { \"axles\": 2 } }"); var tollsGpsTracesResponse = CoordExtentions.Send(request); Assert.IsNotNull(tollsGpsTracesResponse); }
public static TollsCostResponse Send(TollsGpsTracesRequest req) { return(TollsClient.GetSingletonInstance().SendGpsTracesRequest(req)); }
public static Task <TollsCostResponse> SendAsync(TollsGpsTracesRequest req) { return(TollsClient.GetSingletonInstance().SendGpsTracesRequestAsync(req)); }
public TollsCostResponse SendGpsTracesRequest(TollsGpsTracesRequest req) { return(SendGpsTracesRequestAsync(req).Result); }