private async Task PostPayloadAsync(Payload payload) { using (var client = BuildHttpClient()) { var data = JsonConvert.SerializeObject(payload); var response = await client.PostAsync(_uri, new StringContent(data, Encoding.UTF8, "application/json")); } }
private Payload BuildPayload(string text, string username, string channel, IEnumerable<Attachment> attachments = null) { username = username ?? ""; var payload = new Payload { Channel = channel, Username = username, Text = text, Attachments = attachments }; return payload; }