namespace RecalVA;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Xml.Linq;
using System.Linq;

class Program
{
    static async Task Main(string[] args)
    {
        Console.WriteLine("Hello, World!");
        using HttpClient client = new HttpClient();
        try
        {
            string url = "http://172.19.2.33:8082/api/Trafilog/getVehicleTrips?ASSET_ID=325353&DATE=2025-04-15&START_TIME=02:15&END_TIME=02:55";
            HttpResponseMessage response = await client.GetAsync(url);

            response.EnsureSuccessStatusCode(); // lanza excepción si falla
            string responseBody = await response.Content.ReadAsStringAsync();

            Console.WriteLine(responseBody);
        }
        catch (HttpRequestException e)
        {
            Console.WriteLine($"Error en la petición: {e.Message}");
        }

    }
}
