I'm trying to make an HTTP POST request, I'm having problems adding an authorization in the header that has special characters like / and =
The code I use is the following
HttpRequestMessage request = new HttpRequestMessage(method, requestUri);
foreach (var h in headers)
{
request.Headers.Add(h.Key, h.Value);
}
And the exception I get
The format of value 'kAw4dhLDTHY8HvEZWZmv7k6/PHw=' is invalid."
StackTrace " at System.Net.Http.Headers.HttpHeaderParser.ParseValue(String value, Object storeValue, Int32& index)\r\n at System.Net.Http.Headers.HttpHeaders.ParseAndAddValue(HeaderDescriptor descriptor, HeaderStoreItemInfo info, String value) \r\n at System.Net.Http.Headers.HttpHeaders.Add(HeaderDescriptor descriptor, String value)\r\n at System.Net.Http.Headers.HttpHeaders.Add(String name, String value)\r\n
I tried several ways but I did not find a solution
I hope you can help me
Thank you very much
Cheers