I have RestAPI and it's Authorized by API Key and the Key must be adding in the HTTP request header, i tryed the below:
HttpClient client = new HttpClient(clientHandler);
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("ApiKey", "myApiKey");
But still I get:
- StatusCode: 401
- ReasonPhrase: 'Unauthorized'
How to include the API-Key in my HTTP Request Header?