public SyncthingApiClient(Uri baseAddress, string apiKey) { var httpClient = new HttpClient(new SyncthingHttpClientHandler()) { BaseAddress = baseAddress.NormalizeZeroHost(), Timeout = TimeSpan.FromSeconds(70), }; this.api = new RestClient(httpClient) { JsonSerializerSettings = new JsonSerializerSettings() { Converters = { new EventConverter() } } }.For<ISyncthingApi>(); this.api.ApiKey = apiKey; }
public SyncthingApiClient(Uri baseAddress, string apiKey) { var httpClient = new HttpClient(new SyncthingHttpClientHandler()) { BaseAddress = baseAddress.NormalizeZeroHost(), Timeout = TimeSpan.FromSeconds(70), }; this.api = new RestClient(httpClient) { JsonSerializerSettings = new JsonSerializerSettings() { Converters = { new EventConverter() } } }.For <ISyncthingApi>(); this.api.ApiKey = apiKey; }