Ejemplo n.º 1
0
        public DefaultHttpClient(XiaoMiPushOption option)
        {
            if (option == null)
            {
                throw new ArgumentNullException(nameof(option));
            }
            _httpClient = new HttpClient();
            var authorizationSb = new StringBuilder();

            authorizationSb.Append("key=").Append(option.AppSercet);
            var authorization = authorizationSb.ToString();

            _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", authorization);
        }
Ejemplo n.º 2
0
 public SenderV3(DefaultHttpClient defaultHttpClient, AbstractXiaoMiPushLoggerFactory abstractXiaoMiPushLoggerFactory, XiaoMiPushOption option)
 {
     _defaultHttpClient = defaultHttpClient;
     _logger            = abstractXiaoMiPushLoggerFactory.GetLogger(typeof(SenderV3));;
     EndPoint           = option.UseSandbox ? SANDBOX_ENDPOINT : PRODUCTION_ENDPOINT;
 }