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; }
public HttpClientConfigurator(HttpSettings settings) { _settings = settings; }
public Task <byte[]> GetPayloadAsync(HttpSettings settings) { return(Task.FromResult(Payload)); }