var client = new HttpClient(); client.DefaultRequestHeaders.Add("Authorization", "Bearer auth_token");
var client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));In this example, we are adding a content type header to an HttpClient instance. The header tells the server that the client can accept responses in JSON format. Package: System.Net.Http.Headers