public VaptchaDownCheckHttpClient(
            IOptions <VaptchaOptions> vaptchaOptions,
            HttpClient httpClient
            )
        {
            this.vaptchaOptions = vaptchaOptions?.Value ?? throw new ArgumentNullException(nameof(vaptchaOptions));
            this.httpClient     = httpClient ?? throw new ArgumentNullException(nameof(httpClient));

            httpClient.BaseAddress = new Uri(this.vaptchaOptions.DownModeBasePath);
        }
Beispiel #2
0
 public VaptchaHttpClient(
     IOptions <VaptchaOptions> vaptchaOptions,
     IOptions <VaptchaKeyOptions> vaptchaKeyOptions,
     HttpClient httpClient,
     VaptchaDownCheckHttpClient vaptchaDownCheckHttpClient,
     ILogger <VaptchaHttpClient> logger
     )
 {
     this.vaptchaOptions        = vaptchaOptions?.Value ?? throw new ArgumentNullException(nameof(vaptchaOptions));
     this.vaptchaKeyOptions     = vaptchaKeyOptions?.Value ?? throw new ArgumentNullException(nameof(vaptchaKeyOptions));
     this.httpClient            = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
     VaptchaDownCheckHttpClient = vaptchaDownCheckHttpClient ?? throw new ArgumentNullException(nameof(vaptchaDownCheckHttpClient));
     this.logger            = logger ?? throw new ArgumentNullException(nameof(logger));
     httpClient.BaseAddress = new Uri(this.vaptchaOptions.ApiUrl);
 }