// Subscriber
        public GovDeliveryApiService(GovDeliveryServer server, string accountCode, string username, string password) : base(server, accountCode)
        {
            var credentialBytes = Encoding.UTF8.GetBytes($"{username}:{password}");

            client             = new HttpClient();
            client.BaseAddress = new Uri($"{baseUri}/api/account/{accountCode}/");
            client.DefaultRequestHeaders.Authorization =
                new AuthenticationHeaderValue("Basic", Convert.ToBase64String(credentialBytes));
        }
Пример #2
0
 public BaseGovDeliveryService(GovDeliveryServer server, string accountCode)
 {
     this.baseUri     = (server == GovDeliveryServer.Main) ? MAIN_URI : STAGING_URI;
     this.accountCode = accountCode;
 }
 public MockGovDeliveryApiService(GovDeliveryServer server, string accountCode) : base(server, accountCode)
 {
 }