예제 #1
0
 public CustomWebClient()
 {
     Settings = new CustomWebClientSettings
     {
         Encoding = "UTF-8",
         Headers = new[] { "FirstHeader", "SecondHeader" },
         Timeout = TimeSpan.FromSeconds(30),
         Method = "GET"
     };
 }
예제 #2
0
파일: Program.cs 프로젝트: emretiryaki/Blog
 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);
 }