public RemoteLogger(IRemoteLoggerConfiguration config) { // set configuration _configuration = config; // if no configuration provided, throw exception if (_configuration == null) { throw new ArgumentNullException(nameof(config)); } }
private async Task DoSendAsync(Message message, IRemoteLoggerConfiguration configuration) { // create http client var client = new HttpClient() { BaseAddress = configuration.Endpoint }; // serialise to json var json = JsonConvert.SerializeObject(message); // create http content var content = new StringContent(json); // post message var response = await client.PostAsync(configuration.MessageDropPath, content); }