Exemple #1
0
 public AadeClient(string userId, string subscriptionKey, AadeEnvironment environment = AadeEnvironment.Production, AadeLogger logger = null)
 {
     UserId          = userId;
     SubscriptionKey = subscriptionKey;
     Logger          = logger;
     RestClient      = new RestClient(userId, subscriptionKey, environment, logger);
 }
Exemple #2
0
        internal RestClient(string userId, string subscriptionKey, AadeEnvironment environment, AadeLogger logger = null)
        {
            UserId          = userId ?? throw new ArgumentNullException(userId);
            SubscriptionKey = subscriptionKey ?? throw new ArgumentNullException(subscriptionKey);

            BaseUri = environment == AadeEnvironment.Production
                ? ProductionBaseUri
                : SandboxBaseUri;

            Logger = logger;

            HttpClient = new HttpClient();
            HttpClient.DefaultRequestHeaders.Add(UserIdHeaderName, $"{UserId}");
            HttpClient.DefaultRequestHeaders.Add(SubscriptionKeyHeaderName, $"{SubscriptionKey}");
        }