예제 #1
0
 public ChargeClient(Uri uri, string cookieFilePath, Network network, HttpClient httpClient = null, bool allowInsecure = false)
 {
     if (uri == null)
     {
         throw new ArgumentNullException(nameof(uri));
     }
     if (network == null)
     {
         throw new ArgumentNullException(nameof(network));
     }
     if (cookieFilePath == null)
     {
         throw new ArgumentNullException(nameof(cookieFilePath));
     }
     httpClient           = CreateHttpClient(uri, allowInsecure, httpClient ?? SharedClient);
     _Client              = httpClient;
     this._Uri            = uri;
     this._Network        = network;
     ChargeAuthentication = new ChargeAuthentication.CookieFileAuthentication(cookieFilePath);
 }
 public ChargeClient(Uri uri, string cookieFilePath, Network network, HttpClient httpClient)
 {
     if (uri == null)
     {
         throw new ArgumentNullException(nameof(uri));
     }
     if (network == null)
     {
         throw new ArgumentNullException(nameof(network));
     }
     if (cookieFilePath == null)
     {
         throw new ArgumentNullException(nameof(cookieFilePath));
     }
     httpClient           = httpClient ?? _SharedClient;
     _Client              = httpClient;
     this._Uri            = uri;
     this._Network        = network;
     ChargeAuthentication = new ChargeAuthentication.CookieFileAuthentication(cookieFilePath);
 }