public SyncThingApiClientV0p10(Uri baseAddress, string apiKey)
 {
     var httpClient = new HttpClient(new SyncThingHttpClientHandler())
     {
         BaseAddress = baseAddress.NormalizeZeroHost(),
         Timeout = TimeSpan.FromSeconds(70),
     };
     this.api = RestClient.For<ISyncThingApiV0p10>(httpClient, new JsonSerializerSettings()
     {
         Converters = { new EventConverter() }
     });
     this.api.ApiKey = apiKey;
 }
Example #2
0
        public SyncThingApiClientV0p10(Uri baseAddress, string apiKey)
        {
            var httpClient = new HttpClient(new SyncThingHttpClientHandler())
            {
                BaseAddress = baseAddress.NormalizeZeroHost(),
                Timeout     = TimeSpan.FromSeconds(70),
            };

            this.api = RestClient.For <ISyncThingApiV0p10>(httpClient, new JsonSerializerSettings()
            {
                Converters = { new EventConverter() }
            });
            this.api.ApiKey = apiKey;
        }
Example #3
0
        public SyncThingApiClientV0p10(Uri baseAddress, string apiKey)
        {
            var httpClient = new HttpClient(new AuthenticatedHttpClientHandler(apiKey))
            {
                BaseAddress = baseAddress.NormalizeZeroHost(),
                Timeout     = TimeSpan.FromSeconds(70),
            };

            this.api = RestService.For <ISyncThingApiV0p10>(httpClient, new RefitSettings()
            {
                JsonSerializerSettings = new JsonSerializerSettings()
                {
                    Converters = { new EventConverter() }
                },
            });
        }