Пример #1
0
 public async Task ForwardGithubEvent(SlackPayload payload)
 {
     using (HttpClient httpClient = new HttpClient())
     {
         var response = await httpClient.PostAsync(uri, new StringContent(JsonConvert.SerializeObject(payload), System.Text.Encoding.UTF8, "application/json"));
         response.EnsureSuccessStatusCode();
     }
 }
 public async Task<IHttpActionResult> ProcessIssueEvent(Models.IssueEvent issueEvent)
 {
     try
     {
         if (CheckLabel(issueEvent))
         {
             var client = new SlackClient(SlackUrl);
             var payload = new SlackPayload(issueEvent.issue.Title, issueEvent.issue.Url.AbsoluteUri);
             await client.ForwardGithubEvent(payload);
         }
     }
     catch (Exception ex)
     {
         return BadRequest();
     }
     return Ok();
 }