public async Task <CreateTrelloCard> CreateNewCard(TrelloCardDto trelloCardDto) { HttpResponseMessage response = await httpClient.PostAsync(CreateUrlPOST(trelloCardDto), null); var content = response.Content.ReadAsAsync <CreateTrelloCard>(); return(content.Result); }
public Task <CreateTrelloCard> CreateTrelloCard(TrelloCardDto trelloCardDto) { Task <CreateTrelloCard> newCard = trelloClient.CreateNewCard(trelloCardDto); if (newCard != null) { emailService.SendEmailAsync("*****@*****.**", "Created new Card", "It's work!"); } return(newCard); }
private Uri CreateUrlPOST(TrelloCardDto trelloCardDto) { UriBuilder uri = new UriBuilder(); uri.Scheme = "https"; uri.Host = trelloConfig.Endpoint; uri.Path = "cards"; uri.Query = "name=" + trelloCardDto.Name + "&desc=" + trelloCardDto.Description + "&pos=" + trelloCardDto.Pos + "&idList=" + trelloCardDto.ListId + "&key=" + trelloConfig.Key + "&token=" + trelloConfig.Token; return(uri.Uri); }
public Task <CreateTrelloCard> GetCreateTrelloCard([FromBody] TrelloCardDto trelloCardDto) { return(trelloService.CreateTrelloCard(trelloCardDto)); }