I am trying to use the web api\'s HttpClient to do a post to an endpoint that requires login in the form of an HTTP cookie that identifies an account (this is o
For me the simple solution works to set cookies in HttpRequestMessage object.
protected async Task SendRequest(HttpRequestMessage requestMessage, CancellationToken cancellationToken = default(CancellationToken))
{
requestMessage.Headers.Add("Cookie", $"=;=");
return await _httpClient.SendAsync(requestMessage, cancellationToken).ConfigureAwait(false);
}