private static Dictionary<string, string> GetHeadersDictionaryFrom(WebHeaderCollection headers)
{
string pattern = "\\s+";
Dictionary<string, string> dictionary = new Dictionary<string, string>();
for (int i = 0; i < headers.Keys.Count; i++)
{
string key = headers.GetKey(i).Replace("-", " ").ToUpper();
key = Regex.Replace(key, pattern, "");
string value = headers.Get(headers.GetKey(i));
//System.Console.WriteLine("Key => " + key + " Value => " + value);
dictionary.Add(key, value);
}
return dictionary;
}