I have an HttpClient that I am using for a REST API. However I am having trouble setting up the Authorization header. I need to set the header to the token I received from d
I suggest to you:
HttpClient.DefaultRequestHeaders.Add("Authorization", "Bearer ");
And then you can use it like that:
var response = await client.GetAsync(url); if (response.IsSuccessStatusCode) { responseMessage = await response.Content.ReadAsAsync(); }