I've found a work around for this, but I have a client with a server that is throwing 400 errors when I make a GET request with an empty Authorization header. It works just fine when there is no Authorization header. I'd like to explain \ or fix the issue, instead of just say I fixed it.
My old code was this:
request.Headers["Authorization"] = _Request.ServerVariables["HTTP_AUTHORIZATION"] ?? string.Empty;
request.GetResponse();
I switched to this:
if (_Request.ServerVariables["HTTP_AUTHORIZATION"] != null)
{
request.Headers["Authorization"] = _Request.ServerVariables["HTTP_AUTHORIZATION"];
}
request.GetResponse();