public async Task PostAsync(IEnumerable <Event> events)
 {
     if (events == null || events.Count() == 0)
     {
         throw new ArgumentException("Event list cannot be empty or null.");
     }
     await client.sendAsyncRequest(
         HttpMethod.Post,
         string.Format("events"),
         EventSerializer.SerializeEvents(events));
 }
예제 #2
0
        public async Task <IEnumerable <EventResult> > SendAsync(IEnumerable <Event> events)
        {
            if (events == null || events.Count() == 0)
            {
                throw new ArgumentException("Event list cannot be empty or null.");
            }
            var asyncResult = await client.sendAsyncRequestWithResult(
                HttpMethod.Post,
                "events?report_results=true",
                EventSerializer.SerializeEvents(events));

            return(JsonConvert.DeserializeObject <IEnumerable <EventResult> >(asyncResult));
        }