コード例 #1
0
 private void ApplySettings(HttpSettings settings)
 {
     if (settings == null)
     {
         return;
     }
     MaxResponseBufferSize = MaxResponseBufferSize ?? settings.MaxResponseBufferSize;
     TimeOut         = TimeOut ?? settings.TimeOut;
     ProtocolVersion = string.IsNullOrEmpty(ProtocolVersion) ? settings.ProtocolVersion : ProtocolVersion;
     ContentType     = string.IsNullOrEmpty(ContentType) ? settings.ContentType : ContentType;
     foreach (var header in settings.Headers)
     {
         if (Headers.ContainsKey(header.Key) == false)
         {
             Headers[header.Key] = header.Value;
         }
     }
     IsProxyDisabled = settings.IsProxyDisabled;
 }
コード例 #2
0
 public HttpClientConfigurator(HttpSettings settings)
 {
     _settings = settings;
 }
コード例 #3
0
 public Task <byte[]> GetPayloadAsync(HttpSettings settings)
 {
     return(Task.FromResult(Payload));
 }