I am creating an HTTP POST request with HttpClient and HttpRequestMessage in c#. The site I am trying to post to has an authentication header that is case sensitive with the name "AUTHORIZATION". When I try to add this header to my c# HttpRequestMessage using the following code:
Req.Headers.Add("AUTHORIZATION", "Bearer " + bearer);
I end up getting a post request that contains a header name "Authorization". I believe this is because it is recognizing my header as an authentication header and is changing it. The problem is that the website checking for this header is case-sensitive. I end up getting a 403 forbidden response as a result.
I have looked everywhere to try and find a solution, but I cannot find anyone with the same issue. Does anyone know how to fix this?