Discussions

Ask a Question
Back to All

quyering data bad request

I'm trying to reach api/timesheets, but I keep getting a 400 error. I've tried both cURL and HttpClient, but nothing seems to work. What am I missing?

"


        var client = new HttpClient();
        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Get,
            RequestUri = new Uri("https://api-region.zuperpro.com/api/timesheets"),
            Headers =
            {
                { "accept", "application/json" },
                { "x-api-key", "**************************" },
            },
        };
        using (var response = await client.SendAsync(request))
        {
            response.EnsureSuccessStatusCode();
            var body = await response.Content.ReadAsStringAsync();
            Console.WriteLine(body);
        }

"