Пример #1
0
        public async Task <IActionResult> PostTestRoadTrafficReport([FromBody] string payLoad)
        {
            using var fiwareClient = new FIWAREClient();
            var response = await fiwareClient.SendUltraLight(HttpMethod.Post,
                                                             FIWAREUrls.UltraLightMeasurementUrl(FIWAREUrls.RoadTrafficDeviceIds.FirstOrDefault()), payLoad);

            var success = response.IsSuccessStatusCode;

            return(Ok(success));
        }
Пример #2
0
        public async Task <IActionResult> PostTestRoadTrafficReport()
        {
            var roadTraffic = new FiwareTrafficReport(1)
            {
                StartTime      = DateTime.UtcNow,
                City           = "Random",
                AddressNumber  = "AddrNr",
                StartLatitude  = 37.9600965,
                StartLongitude = 23.8576043
            };

            using var fiwareClient = new FIWAREClient();
            var response = await fiwareClient.SendUltraLight(HttpMethod.Post,
                                                             FIWAREUrls.UltraLightMeasurementUrl(FIWAREUrls.RoadTrafficDeviceIds.FirstOrDefault()), roadTraffic.ToUltraLightSyntax());

            var success = response.IsSuccessStatusCode;

            return(Ok(success));
        }