I am struggling to understand how to add MULTIPLE headers to the HttpRequestMessage. I mean I get the basics and if I do one header it works but multiple headers and the last one is what sticks and all others are overwritten?
So for example the Accept header will be overwritten but the authorization header will stick.
HttpRequestMessage httpreqmsg = new HttpRequestMessage();
httpreqmsg.Headers.Add("Accept", "CustomAccept");
httpreqmsg.Headers.Add("Authorization", "asdfas#%fwqerq@werfds...");
Now HttpRequestMessage has an overload with the signature
.Add(string, List<string>)
and that is fine if you have ONE name with multiple values but how do you do multiple headers. TryAddWithoutValidation has the same overloads as above?
TIA
Great...so I kinda made a mistake in my post. I didn't think it mattered but it does. I am unit testing a controller and therefore there is no HttpClient object created.