Esempio n. 1
0
 public CustomWebClient()
 {
     Settings = new CustomWebClientSettings
     {
         Encoding = "UTF-8",
         Headers  = new[] { "FirstHeader", "SecondHeader" },
         Timeout  = TimeSpan.FromSeconds(30),
         Method   = "GET"
     };
 }
Esempio n. 2
0
 private static void PrintComparedSettings(CustomWebClientSettings defaultSettings, CustomWebClientSettings replacedSettings)
 {
     Console.WriteLine("Replaced setting \"Encoding\" now has value {0} as intended",
                       replacedSettings.Encoding);
     Console.WriteLine("Replaced setting \"Method\" now has value {0} as intended",
                       replacedSettings.Method);
     Console.WriteLine("Default setting \"Headers\"  {0} replaced settings headers: {1}",
                       string.Join(",", defaultSettings.Headers), string.Join(",", replacedSettings.Headers ?? new[] { "NULL" }));
     Console.WriteLine("Default setting \"Timeout\" {0} replaced settings timeout: {1}", defaultSettings.Timeout,
                       replacedSettings.Timeout);
 }