protected BaseWebApi(SendCloudConfig config) { Config = config; Client = new HttpClient(); PostMethod = new HttpPost(); GetMethod = new HttpGet(); Response = new HttpResponse(); }
public SendCloudSmsTest() { var configuration = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", false, true) .Build(); _config = configuration.GetSection("SMS:SendCloud").Get <SendCloudConfig>(); _client = new SendCloudClient(_config); }
public SendCloudClient(SendCloudConfig config, Action <Exception> exceptionHandler = null) { _config = config ?? throw new ArgumentNullException(nameof(config)); _sendCloudAccount = config.Account ?? throw new ArgumentNullException(nameof(config.Account)); _proxy = HttpApiClient.Create <ISendCloudApi>(); var globalHandle = ExceptionHandleResolver.ResolveHandler(); globalHandle += exceptionHandler; _exceptionHandler = globalHandle; }
public EmailWebApi(SendCloudConfig config) : base(config) { }
public SmsWebApi(SendCloudConfig config) : base(config) { }