I have the following code to add logs to log analytics:
private static readonly HttpClient httpClient = MakeClient();
private static HttpClient MakeClient()
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Log-Type", "ApplicationLog");
return client;
}
On running this, I get the below exception:
The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing. The operation was canceled. The operation was canceled. The read operation failed, see inner exception. Cannot access a disposed object. Object name: 'SslStream'.
on this line:
var response = await httpClient.SendAsync(
CreateRequest(HttpMethod.Post, url, scheme, parameter, dateString, serializedMessage, contentType));
What am I missing?