I'm trying to send a request like this:
var req = new HttpRequestMessage(HttpMethod.Get, requestUri);
req.SetBrowserRequestMode(BrowserRequestMode.NoCors);
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
var resp = await httpClient.SendAsync(req, cancellationToken);
I see that authrozation header that I set does not send. But if I remove the 2nd line it will send. I need to set the 2nd line.
Why it should not send authorization when setting BrowserRequestMode to NoCors?