Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
        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;
        }