/// <constructor /> public CouchApi(CouchApiSettings settings, HttpMessageHandler messageHandler = null) : base(messageHandler ?? new HttpClientHandler()) { Settings = settings; uriConstructor = new UriConstructor(settings.ServerUri); synchronousCouchApi = new SynchronousCouchApi(this); replicatorApi = new ReplicatorApi(this); BaseAddress = settings.ServerUri; DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(MediaType.Json)); DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip")); DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("deflate")); if (settings.Credentials != null) DefaultRequestHeaders.Authorization = settings.Credentials.ToAuthenticationHeader(); }
/// <constructor /> public CouchApi(CouchApiSettings settings, HttpMessageHandler messageHandler = null) : base(messageHandler ?? new HttpClientHandler()) { Settings = settings; uriConstructor = new UriConstructor(settings.ServerUri); synchronousCouchApi = new SynchronousCouchApi(this); replicatorApi = new ReplicatorApi(this); BaseAddress = settings.ServerUri; DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(MediaType.Json)); DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip")); DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("deflate")); if (settings.Credentials != null) { DefaultRequestHeaders.Authorization = settings.Credentials.ToAuthenticationHeader(); } }