• Почему не работает запрос к апи?

    @newtest1
    Попробуй это

    static HttpClient newclient = new HttpClient();

    public static async Task Main(string[] args)
    {
    string url = "https://test/test/test";
    string sinceDateTimeUtc = "2020-01-01T00:00:00.000";
    string tillDateTimeUtc = "2022-12-11T00:00:00.000";
    string Authorization = "bfskjdnflsanlk12fns";
    var data = new Dictionary();
    data["sinceDateTimeUtc"] = sinceDateTimeUtc;
    data["tillDateTimeUtc"] = tillDateTimeUtc;
    string result;
    using (HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, url))
    {

    requestMessage.Headers.Add("Content-Type", "application/json");
    requestMessage.Headers.Add("Accept", "application/json");
    requestMessage.Headers.Add("Authorization", Authorization);
    var response = await newclient.SendAsync(requestMessage);
    result = await response.Content.ReadAsStringAsync();
    };
    System.Console.WriteLine(result);

    }
    Ответ написан