protected override Task OnSendEventAsync(Message message) { if (message == null) { throw Fx.Exception.ArgumentNull("message"); } var customHeaders = new Dictionary<string, string>(message.SystemProperties.Count + message.Properties.Count); foreach (var property in message.SystemProperties) { customHeaders.Add(MapMessageProperties2HttpHeaders[property.Key], property.Value.ToString()); } foreach (var property in message.Properties) { customHeaders.Add(CustomHeaderConstants.HttpAppPropertyPrefix + property.Key, property.Value); } return this.httpClientHelper.PostAsync<byte[]>( GetRequestUri(this.deviceId, CommonConstants.DeviceEventPathTemplate, null), message.GetBytes(), ExceptionHandlingHelper.GetDefaultErrorMapping(), customHeaders, CancellationToken.None); }