Пример #1
0
        public async Task <IActionResult> PostTestWeatherMeasurement(FiwareWeatherReport model)
        {
            using var fiwareClient = new FIWAREClient();
            var response = await fiwareClient.SendJson(HttpMethod.Post,
                                                       FIWAREUrls.JsonMeasurementUrl(FIWAREUrls.WeatherDeviceIds.FirstOrDefault()), model);

            var success = response.IsSuccessStatusCode;

            return(Ok(success));
        }
Пример #2
0
        public async Task <IActionResult> PostTestWeatherMeasurement()
        {
            var weatherEvent = new FiwareWeatherReport(1)
            {
                Temperature   = 12,
                WindChill     = 0,
                Humidity      = 02,
                Pressure      = 33.33,
                Visibility    = 100,
                WindDirection = "NWD",
                WindSpeed     = 120.1,
                Precipitation = 30.5,
                ReportTime    = DateTime.UtcNow
            };

            using var fiwareClient = new FIWAREClient();
            var response = await fiwareClient.SendJson(HttpMethod.Post,
                                                       FIWAREUrls.JsonMeasurementUrl(FIWAREUrls.WeatherDeviceIds.FirstOrDefault()), weatherEvent);

            var success = response.IsSuccessStatusCode;

            return(Ok(success));
        }